1#![doc = "MAVLink ardupilotmega dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21pub const DIALECT_NUMBER: u8 = 2u8;
22#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
23#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24#[cfg_attr(feature = "serde", serde(tag = "type"))]
25#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26#[repr(u32)]
27pub enum AccelcalVehiclePos {
28 ACCELCAL_VEHICLE_POS_LEVEL = 1,
29 ACCELCAL_VEHICLE_POS_LEFT = 2,
30 ACCELCAL_VEHICLE_POS_RIGHT = 3,
31 ACCELCAL_VEHICLE_POS_NOSEDOWN = 4,
32 ACCELCAL_VEHICLE_POS_NOSEUP = 5,
33 ACCELCAL_VEHICLE_POS_BACK = 6,
34 ACCELCAL_VEHICLE_POS_SUCCESS = 16777215,
35 ACCELCAL_VEHICLE_POS_FAILED = 16777216,
36}
37impl AccelcalVehiclePos {
38 pub const DEFAULT: Self = Self::ACCELCAL_VEHICLE_POS_LEVEL;
39}
40impl Default for AccelcalVehiclePos {
41 fn default() -> Self {
42 Self::DEFAULT
43 }
44}
45#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
46#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
47#[cfg_attr(feature = "serde", serde(tag = "type"))]
48#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
49#[repr(u32)]
50#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
51pub enum ActuatorConfiguration {
52 #[doc = "Do nothing."]
53 ACTUATOR_CONFIGURATION_NONE = 0,
54 #[doc = "Command the actuator to beep now."]
55 ACTUATOR_CONFIGURATION_BEEP = 1,
56 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
57 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
58 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
59 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
60 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
61 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
62 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
63 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
64}
65impl ActuatorConfiguration {
66 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
67}
68impl Default for ActuatorConfiguration {
69 fn default() -> Self {
70 Self::DEFAULT
71 }
72}
73#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
74#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
75#[cfg_attr(feature = "serde", serde(tag = "type"))]
76#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
77#[repr(u32)]
78#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
79pub enum ActuatorOutputFunction {
80 #[doc = "No function (disabled)."]
81 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
82 #[doc = "Motor 1"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
84 #[doc = "Motor 2"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
86 #[doc = "Motor 3"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
88 #[doc = "Motor 4"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
90 #[doc = "Motor 5"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
92 #[doc = "Motor 6"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
94 #[doc = "Motor 7"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
96 #[doc = "Motor 8"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
98 #[doc = "Motor 9"]
99 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
100 #[doc = "Motor 10"]
101 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
102 #[doc = "Motor 11"]
103 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
104 #[doc = "Motor 12"]
105 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
106 #[doc = "Motor 13"]
107 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
108 #[doc = "Motor 14"]
109 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
110 #[doc = "Motor 15"]
111 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
112 #[doc = "Motor 16"]
113 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
114 #[doc = "Servo 1"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
116 #[doc = "Servo 2"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
118 #[doc = "Servo 3"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
120 #[doc = "Servo 4"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
122 #[doc = "Servo 5"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
124 #[doc = "Servo 6"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
126 #[doc = "Servo 7"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
128 #[doc = "Servo 8"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
130 #[doc = "Servo 9"]
131 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
132 #[doc = "Servo 10"]
133 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
134 #[doc = "Servo 11"]
135 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
136 #[doc = "Servo 12"]
137 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
138 #[doc = "Servo 13"]
139 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
140 #[doc = "Servo 14"]
141 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
142 #[doc = "Servo 15"]
143 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
144 #[doc = "Servo 16"]
145 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
146}
147impl ActuatorOutputFunction {
148 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
149}
150impl Default for ActuatorOutputFunction {
151 fn default() -> Self {
152 Self::DEFAULT
153 }
154}
155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
157#[cfg_attr(feature = "serde", serde(tag = "type"))]
158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
159#[repr(u32)]
160#[doc = "Enumeration of the ADSB altimeter types"]
161pub enum AdsbAltitudeType {
162 #[doc = "Altitude reported from a Baro source using QNH reference"]
163 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
164 #[doc = "Altitude reported from a GNSS source"]
165 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
166}
167impl AdsbAltitudeType {
168 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
169}
170impl Default for AdsbAltitudeType {
171 fn default() -> Self {
172 Self::DEFAULT
173 }
174}
175#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
177#[cfg_attr(feature = "serde", serde(tag = "type"))]
178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
179#[repr(u32)]
180#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
181pub enum AdsbEmitterType {
182 ADSB_EMITTER_TYPE_NO_INFO = 0,
183 ADSB_EMITTER_TYPE_LIGHT = 1,
184 ADSB_EMITTER_TYPE_SMALL = 2,
185 ADSB_EMITTER_TYPE_LARGE = 3,
186 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
187 ADSB_EMITTER_TYPE_HEAVY = 5,
188 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
189 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
190 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
191 ADSB_EMITTER_TYPE_GLIDER = 9,
192 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
193 ADSB_EMITTER_TYPE_PARACHUTE = 11,
194 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
195 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
196 ADSB_EMITTER_TYPE_UAV = 14,
197 ADSB_EMITTER_TYPE_SPACE = 15,
198 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
199 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
200 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
201 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
202}
203impl AdsbEmitterType {
204 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
205}
206impl Default for AdsbEmitterType {
207 fn default() -> Self {
208 Self::DEFAULT
209 }
210}
211bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
212impl AdsbFlags {
213 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
214}
215impl Default for AdsbFlags {
216 fn default() -> Self {
217 Self::DEFAULT
218 }
219}
220#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
222#[cfg_attr(feature = "serde", serde(tag = "type"))]
223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
224#[repr(u32)]
225pub enum AirlinkAuthResponseType {
226 #[doc = "Login or password error"]
227 AIRLINK_ERROR_LOGIN_OR_PASS = 0,
228 #[doc = "Auth successful"]
229 AIRLINK_AUTH_OK = 1,
230}
231impl AirlinkAuthResponseType {
232 pub const DEFAULT: Self = Self::AIRLINK_ERROR_LOGIN_OR_PASS;
233}
234impl Default for AirlinkAuthResponseType {
235 fn default() -> Self {
236 Self::DEFAULT
237 }
238}
239bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
240impl AisFlags {
241 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
242}
243impl Default for AisFlags {
244 fn default() -> Self {
245 Self::DEFAULT
246 }
247}
248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
250#[cfg_attr(feature = "serde", serde(tag = "type"))]
251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
252#[repr(u32)]
253#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
254pub enum AisNavStatus {
255 #[doc = "Under way using engine."]
256 UNDER_WAY = 0,
257 AIS_NAV_ANCHORED = 1,
258 AIS_NAV_UN_COMMANDED = 2,
259 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
260 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
261 AIS_NAV_MOORED = 5,
262 AIS_NAV_AGROUND = 6,
263 AIS_NAV_FISHING = 7,
264 AIS_NAV_SAILING = 8,
265 AIS_NAV_RESERVED_HSC = 9,
266 AIS_NAV_RESERVED_WIG = 10,
267 AIS_NAV_RESERVED_1 = 11,
268 AIS_NAV_RESERVED_2 = 12,
269 AIS_NAV_RESERVED_3 = 13,
270 #[doc = "Search And Rescue Transponder."]
271 AIS_NAV_AIS_SART = 14,
272 #[doc = "Not available (default)."]
273 AIS_NAV_UNKNOWN = 15,
274}
275impl AisNavStatus {
276 pub const DEFAULT: Self = Self::UNDER_WAY;
277}
278impl Default for AisNavStatus {
279 fn default() -> Self {
280 Self::DEFAULT
281 }
282}
283#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
285#[cfg_attr(feature = "serde", serde(tag = "type"))]
286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
287#[repr(u32)]
288#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
289pub enum AisType {
290 #[doc = "Not available (default)."]
291 AIS_TYPE_UNKNOWN = 0,
292 AIS_TYPE_RESERVED_1 = 1,
293 AIS_TYPE_RESERVED_2 = 2,
294 AIS_TYPE_RESERVED_3 = 3,
295 AIS_TYPE_RESERVED_4 = 4,
296 AIS_TYPE_RESERVED_5 = 5,
297 AIS_TYPE_RESERVED_6 = 6,
298 AIS_TYPE_RESERVED_7 = 7,
299 AIS_TYPE_RESERVED_8 = 8,
300 AIS_TYPE_RESERVED_9 = 9,
301 AIS_TYPE_RESERVED_10 = 10,
302 AIS_TYPE_RESERVED_11 = 11,
303 AIS_TYPE_RESERVED_12 = 12,
304 AIS_TYPE_RESERVED_13 = 13,
305 AIS_TYPE_RESERVED_14 = 14,
306 AIS_TYPE_RESERVED_15 = 15,
307 AIS_TYPE_RESERVED_16 = 16,
308 AIS_TYPE_RESERVED_17 = 17,
309 AIS_TYPE_RESERVED_18 = 18,
310 AIS_TYPE_RESERVED_19 = 19,
311 #[doc = "Wing In Ground effect."]
312 AIS_TYPE_WIG = 20,
313 AIS_TYPE_WIG_HAZARDOUS_A = 21,
314 AIS_TYPE_WIG_HAZARDOUS_B = 22,
315 AIS_TYPE_WIG_HAZARDOUS_C = 23,
316 AIS_TYPE_WIG_HAZARDOUS_D = 24,
317 AIS_TYPE_WIG_RESERVED_1 = 25,
318 AIS_TYPE_WIG_RESERVED_2 = 26,
319 AIS_TYPE_WIG_RESERVED_3 = 27,
320 AIS_TYPE_WIG_RESERVED_4 = 28,
321 AIS_TYPE_WIG_RESERVED_5 = 29,
322 AIS_TYPE_FISHING = 30,
323 AIS_TYPE_TOWING = 31,
324 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
325 AIS_TYPE_TOWING_LARGE = 32,
326 #[doc = "Dredging or other underwater ops."]
327 AIS_TYPE_DREDGING = 33,
328 AIS_TYPE_DIVING = 34,
329 AIS_TYPE_MILITARY = 35,
330 AIS_TYPE_SAILING = 36,
331 AIS_TYPE_PLEASURE = 37,
332 AIS_TYPE_RESERVED_20 = 38,
333 AIS_TYPE_RESERVED_21 = 39,
334 #[doc = "High Speed Craft."]
335 AIS_TYPE_HSC = 40,
336 AIS_TYPE_HSC_HAZARDOUS_A = 41,
337 AIS_TYPE_HSC_HAZARDOUS_B = 42,
338 AIS_TYPE_HSC_HAZARDOUS_C = 43,
339 AIS_TYPE_HSC_HAZARDOUS_D = 44,
340 AIS_TYPE_HSC_RESERVED_1 = 45,
341 AIS_TYPE_HSC_RESERVED_2 = 46,
342 AIS_TYPE_HSC_RESERVED_3 = 47,
343 AIS_TYPE_HSC_RESERVED_4 = 48,
344 AIS_TYPE_HSC_UNKNOWN = 49,
345 AIS_TYPE_PILOT = 50,
346 #[doc = "Search And Rescue vessel."]
347 AIS_TYPE_SAR = 51,
348 AIS_TYPE_TUG = 52,
349 AIS_TYPE_PORT_TENDER = 53,
350 #[doc = "Anti-pollution equipment."]
351 AIS_TYPE_ANTI_POLLUTION = 54,
352 AIS_TYPE_LAW_ENFORCEMENT = 55,
353 AIS_TYPE_SPARE_LOCAL_1 = 56,
354 AIS_TYPE_SPARE_LOCAL_2 = 57,
355 AIS_TYPE_MEDICAL_TRANSPORT = 58,
356 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
357 AIS_TYPE_NONECOMBATANT = 59,
358 AIS_TYPE_PASSENGER = 60,
359 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
360 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
361 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
362 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
363 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
364 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
365 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
366 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
367 AIS_TYPE_PASSENGER_UNKNOWN = 69,
368 AIS_TYPE_CARGO = 70,
369 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
370 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
371 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
372 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
373 AIS_TYPE_CARGO_RESERVED_1 = 75,
374 AIS_TYPE_CARGO_RESERVED_2 = 76,
375 AIS_TYPE_CARGO_RESERVED_3 = 77,
376 AIS_TYPE_CARGO_RESERVED_4 = 78,
377 AIS_TYPE_CARGO_UNKNOWN = 79,
378 AIS_TYPE_TANKER = 80,
379 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
380 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
381 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
382 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
383 AIS_TYPE_TANKER_RESERVED_1 = 85,
384 AIS_TYPE_TANKER_RESERVED_2 = 86,
385 AIS_TYPE_TANKER_RESERVED_3 = 87,
386 AIS_TYPE_TANKER_RESERVED_4 = 88,
387 AIS_TYPE_TANKER_UNKNOWN = 89,
388 AIS_TYPE_OTHER = 90,
389 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
390 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
391 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
392 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
393 AIS_TYPE_OTHER_RESERVED_1 = 95,
394 AIS_TYPE_OTHER_RESERVED_2 = 96,
395 AIS_TYPE_OTHER_RESERVED_3 = 97,
396 AIS_TYPE_OTHER_RESERVED_4 = 98,
397 AIS_TYPE_OTHER_UNKNOWN = 99,
398}
399impl AisType {
400 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
401}
402impl Default for AisType {
403 fn default() -> Self {
404 Self::DEFAULT
405 }
406}
407bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
408impl AttitudeTargetTypemask {
409 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
410}
411impl Default for AttitudeTargetTypemask {
412 fn default() -> Self {
413 Self::DEFAULT
414 }
415}
416#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
418#[cfg_attr(feature = "serde", serde(tag = "type"))]
419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
420#[repr(u32)]
421#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
422pub enum AutotuneAxis {
423 #[doc = "Autotune roll axis."]
424 AUTOTUNE_AXIS_ROLL = 1,
425 #[doc = "Autotune pitch axis."]
426 AUTOTUNE_AXIS_PITCH = 2,
427 #[doc = "Autotune yaw axis."]
428 AUTOTUNE_AXIS_YAW = 4,
429}
430impl AutotuneAxis {
431 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
432}
433impl Default for AutotuneAxis {
434 fn default() -> Self {
435 Self::DEFAULT
436 }
437}
438bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
439impl CameraCapFlags {
440 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
441}
442impl Default for CameraCapFlags {
443 fn default() -> Self {
444 Self::DEFAULT
445 }
446}
447#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
449#[cfg_attr(feature = "serde", serde(tag = "type"))]
450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
451#[repr(u32)]
452pub enum CameraFeedbackFlags {
453 #[doc = "Shooting photos, not video."]
454 CAMERA_FEEDBACK_PHOTO = 0,
455 #[doc = "Shooting video, not stills."]
456 CAMERA_FEEDBACK_VIDEO = 1,
457 #[doc = "Unable to achieve requested exposure (e.g. shutter speed too low)."]
458 CAMERA_FEEDBACK_BADEXPOSURE = 2,
459 #[doc = "Closed loop feedback from camera, we know for sure it has successfully taken a picture."]
460 CAMERA_FEEDBACK_CLOSEDLOOP = 3,
461 #[doc = "Open loop camera, an image trigger has been requested but we can't know for sure it has successfully taken a picture."]
462 CAMERA_FEEDBACK_OPENLOOP = 4,
463}
464impl CameraFeedbackFlags {
465 pub const DEFAULT: Self = Self::CAMERA_FEEDBACK_PHOTO;
466}
467impl Default for CameraFeedbackFlags {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera Modes."]
478pub enum CameraMode {
479 #[doc = "Camera is in image/photo capture mode."]
480 CAMERA_MODE_IMAGE = 0,
481 #[doc = "Camera is in video capture mode."]
482 CAMERA_MODE_VIDEO = 1,
483 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
484 CAMERA_MODE_IMAGE_SURVEY = 2,
485}
486impl CameraMode {
487 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
488}
489impl Default for CameraMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
496#[cfg_attr(feature = "serde", serde(tag = "type"))]
497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
498#[repr(u32)]
499#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
500pub enum CameraSource {
501 #[doc = "Default camera source."]
502 CAMERA_SOURCE_DEFAULT = 0,
503 #[doc = "RGB camera source."]
504 CAMERA_SOURCE_RGB = 1,
505 #[doc = "IR camera source."]
506 CAMERA_SOURCE_IR = 2,
507 #[doc = "NDVI camera source."]
508 CAMERA_SOURCE_NDVI = 3,
509}
510impl CameraSource {
511 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
512}
513impl Default for CameraSource {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
520#[cfg_attr(feature = "serde", serde(tag = "type"))]
521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
522#[repr(u32)]
523pub enum CameraStatusTypes {
524 #[doc = "Camera heartbeat, announce camera component ID at 1Hz."]
525 CAMERA_STATUS_TYPE_HEARTBEAT = 0,
526 #[doc = "Camera image triggered."]
527 CAMERA_STATUS_TYPE_TRIGGER = 1,
528 #[doc = "Camera connection lost."]
529 CAMERA_STATUS_TYPE_DISCONNECT = 2,
530 #[doc = "Camera unknown error."]
531 CAMERA_STATUS_TYPE_ERROR = 3,
532 #[doc = "Camera battery low. Parameter p1 shows reported voltage."]
533 CAMERA_STATUS_TYPE_LOWBATT = 4,
534 #[doc = "Camera storage low. Parameter p1 shows reported shots remaining."]
535 CAMERA_STATUS_TYPE_LOWSTORE = 5,
536 #[doc = "Camera storage low. Parameter p1 shows reported video minutes remaining."]
537 CAMERA_STATUS_TYPE_LOWSTOREV = 6,
538}
539impl CameraStatusTypes {
540 pub const DEFAULT: Self = Self::CAMERA_STATUS_TYPE_HEARTBEAT;
541}
542impl Default for CameraStatusTypes {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Camera tracking modes"]
553pub enum CameraTrackingMode {
554 #[doc = "Not tracking"]
555 CAMERA_TRACKING_MODE_NONE = 0,
556 #[doc = "Target is a point"]
557 CAMERA_TRACKING_MODE_POINT = 1,
558 #[doc = "Target is a rectangle"]
559 CAMERA_TRACKING_MODE_RECTANGLE = 2,
560}
561impl CameraTrackingMode {
562 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
563}
564impl Default for CameraTrackingMode {
565 fn default() -> Self {
566 Self::DEFAULT
567 }
568}
569#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
571#[cfg_attr(feature = "serde", serde(tag = "type"))]
572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
573#[repr(u32)]
574#[doc = "Camera tracking status flags"]
575pub enum CameraTrackingStatusFlags {
576 #[doc = "Camera is not tracking"]
577 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
578 #[doc = "Camera is tracking"]
579 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
580 #[doc = "Camera tracking in error state"]
581 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
582}
583impl CameraTrackingStatusFlags {
584 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
585}
586impl Default for CameraTrackingStatusFlags {
587 fn default() -> Self {
588 Self::DEFAULT
589 }
590}
591bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
592impl CameraTrackingTargetData {
593 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
594}
595impl Default for CameraTrackingTargetData {
596 fn default() -> Self {
597 Self::DEFAULT
598 }
599}
600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
602#[cfg_attr(feature = "serde", serde(tag = "type"))]
603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
604#[repr(u32)]
605#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
606pub enum CameraZoomType {
607 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
608 ZOOM_TYPE_STEP = 0,
609 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
610 ZOOM_TYPE_CONTINUOUS = 1,
611 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
612 ZOOM_TYPE_RANGE = 2,
613 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
614 ZOOM_TYPE_FOCAL_LENGTH = 3,
615 #[doc = "Zoom value as horizontal field of view in degrees."]
616 ZOOM_TYPE_HORIZONTAL_FOV = 4,
617}
618impl CameraZoomType {
619 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
620}
621impl Default for CameraZoomType {
622 fn default() -> Self {
623 Self::DEFAULT
624 }
625}
626#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
628#[cfg_attr(feature = "serde", serde(tag = "type"))]
629#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
630#[repr(u32)]
631pub enum CanFilterOp {
632 CAN_FILTER_REPLACE = 0,
633 CAN_FILTER_ADD = 1,
634 CAN_FILTER_REMOVE = 2,
635}
636impl CanFilterOp {
637 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
638}
639impl Default for CanFilterOp {
640 fn default() -> Self {
641 Self::DEFAULT
642 }
643}
644#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
646#[cfg_attr(feature = "serde", serde(tag = "type"))]
647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
648#[repr(u32)]
649#[doc = "Possible responses from a CELLULAR_CONFIG message."]
650pub enum CellularConfigResponse {
651 #[doc = "Changes accepted."]
652 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
653 #[doc = "Invalid APN."]
654 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
655 #[doc = "Invalid PIN."]
656 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
657 #[doc = "Changes rejected."]
658 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
659 #[doc = "PUK is required to unblock SIM card."]
660 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
661}
662impl CellularConfigResponse {
663 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
664}
665impl Default for CellularConfigResponse {
666 fn default() -> Self {
667 Self::DEFAULT
668 }
669}
670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
672#[cfg_attr(feature = "serde", serde(tag = "type"))]
673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
674#[repr(u32)]
675#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
676pub enum CellularNetworkFailedReason {
677 #[doc = "No error"]
678 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
679 #[doc = "Error state is unknown"]
680 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
681 #[doc = "SIM is required for the modem but missing"]
682 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
683 #[doc = "SIM is available, but not usable for connection"]
684 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
685}
686impl CellularNetworkFailedReason {
687 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
688}
689impl Default for CellularNetworkFailedReason {
690 fn default() -> Self {
691 Self::DEFAULT
692 }
693}
694#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
696#[cfg_attr(feature = "serde", serde(tag = "type"))]
697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
698#[repr(u32)]
699#[doc = "Cellular network radio type"]
700pub enum CellularNetworkRadioType {
701 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
702 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
703 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
704 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
705 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
706}
707impl CellularNetworkRadioType {
708 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
709}
710impl Default for CellularNetworkRadioType {
711 fn default() -> Self {
712 Self::DEFAULT
713 }
714}
715#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
717#[cfg_attr(feature = "serde", serde(tag = "type"))]
718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
719#[repr(u32)]
720#[doc = "These flags encode the cellular network status"]
721pub enum CellularStatusFlag {
722 #[doc = "State unknown or not reportable."]
723 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
724 #[doc = "Modem is unusable"]
725 CELLULAR_STATUS_FLAG_FAILED = 1,
726 #[doc = "Modem is being initialized"]
727 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
728 #[doc = "Modem is locked"]
729 CELLULAR_STATUS_FLAG_LOCKED = 3,
730 #[doc = "Modem is not enabled and is powered down"]
731 CELLULAR_STATUS_FLAG_DISABLED = 4,
732 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
733 CELLULAR_STATUS_FLAG_DISABLING = 5,
734 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
735 CELLULAR_STATUS_FLAG_ENABLING = 6,
736 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
737 CELLULAR_STATUS_FLAG_ENABLED = 7,
738 #[doc = "Modem is searching for a network provider to register"]
739 CELLULAR_STATUS_FLAG_SEARCHING = 8,
740 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
741 CELLULAR_STATUS_FLAG_REGISTERED = 9,
742 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
743 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
744 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
745 CELLULAR_STATUS_FLAG_CONNECTING = 11,
746 #[doc = "One or more packet data bearers is active and connected"]
747 CELLULAR_STATUS_FLAG_CONNECTED = 12,
748}
749impl CellularStatusFlag {
750 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
751}
752impl Default for CellularStatusFlag {
753 fn default() -> Self {
754 Self::DEFAULT
755 }
756}
757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
759#[cfg_attr(feature = "serde", serde(tag = "type"))]
760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
761#[repr(u32)]
762#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
763pub enum CompMetadataType {
764 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
765 COMP_METADATA_TYPE_GENERAL = 0,
766 #[doc = "Parameter meta data."]
767 COMP_METADATA_TYPE_PARAMETER = 1,
768 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
769 COMP_METADATA_TYPE_COMMANDS = 2,
770 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
771 COMP_METADATA_TYPE_PERIPHERALS = 3,
772 #[doc = "Meta data for the events interface."]
773 COMP_METADATA_TYPE_EVENTS = 4,
774 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
775 COMP_METADATA_TYPE_ACTUATORS = 5,
776}
777impl CompMetadataType {
778 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
779}
780impl Default for CompMetadataType {
781 fn default() -> Self {
782 Self::DEFAULT
783 }
784}
785#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
787#[cfg_attr(feature = "serde", serde(tag = "type"))]
788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
789#[repr(u32)]
790#[doc = "A mapping of copter flight modes for custom_mode field of heartbeat."]
791pub enum CopterMode {
792 #[doc = "STABILIZE"]
793 COPTER_MODE_STABILIZE = 0,
794 #[doc = "ACRO"]
795 COPTER_MODE_ACRO = 1,
796 #[doc = "ALT HOLD"]
797 COPTER_MODE_ALT_HOLD = 2,
798 #[doc = "AUTO"]
799 COPTER_MODE_AUTO = 3,
800 #[doc = "GUIDED"]
801 COPTER_MODE_GUIDED = 4,
802 #[doc = "LOITER"]
803 COPTER_MODE_LOITER = 5,
804 #[doc = "RTL"]
805 COPTER_MODE_RTL = 6,
806 #[doc = "CIRCLE"]
807 COPTER_MODE_CIRCLE = 7,
808 #[doc = "LAND"]
809 COPTER_MODE_LAND = 9,
810 #[doc = "DRIFT"]
811 COPTER_MODE_DRIFT = 11,
812 #[doc = "SPORT"]
813 COPTER_MODE_SPORT = 13,
814 #[doc = "FLIP"]
815 COPTER_MODE_FLIP = 14,
816 #[doc = "AUTOTUNE"]
817 COPTER_MODE_AUTOTUNE = 15,
818 #[doc = "POSHOLD"]
819 COPTER_MODE_POSHOLD = 16,
820 #[doc = "BRAKE"]
821 COPTER_MODE_BRAKE = 17,
822 #[doc = "THROW"]
823 COPTER_MODE_THROW = 18,
824 #[doc = "AVOID ADSB"]
825 COPTER_MODE_AVOID_ADSB = 19,
826 #[doc = "GUIDED NOGPS"]
827 COPTER_MODE_GUIDED_NOGPS = 20,
828 #[doc = "SMARTRTL"]
829 COPTER_MODE_SMART_RTL = 21,
830 #[doc = "FLOWHOLD"]
831 COPTER_MODE_FLOWHOLD = 22,
832 #[doc = "FOLLOW"]
833 COPTER_MODE_FOLLOW = 23,
834 #[doc = "ZIGZAG"]
835 COPTER_MODE_ZIGZAG = 24,
836 #[doc = "SYSTEMID"]
837 COPTER_MODE_SYSTEMID = 25,
838 #[doc = "AUTOROTATE"]
839 COPTER_MODE_AUTOROTATE = 26,
840 #[doc = "AUTO RTL"]
841 COPTER_MODE_AUTO_RTL = 27,
842 #[doc = "TURTLE"]
843 COPTER_MODE_TURTLE = 28,
844}
845impl CopterMode {
846 pub const DEFAULT: Self = Self::COPTER_MODE_STABILIZE;
847}
848impl Default for CopterMode {
849 fn default() -> Self {
850 Self::DEFAULT
851 }
852}
853#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
855#[cfg_attr(feature = "serde", serde(tag = "type"))]
856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
857#[repr(u32)]
858#[doc = "Deepstall flight stage."]
859pub enum DeepstallStage {
860 #[doc = "Flying to the landing point."]
861 DEEPSTALL_STAGE_FLY_TO_LANDING = 0,
862 #[doc = "Building an estimate of the wind."]
863 DEEPSTALL_STAGE_ESTIMATE_WIND = 1,
864 #[doc = "Waiting to breakout of the loiter to fly the approach."]
865 DEEPSTALL_STAGE_WAIT_FOR_BREAKOUT = 2,
866 #[doc = "Flying to the first arc point to turn around to the landing point."]
867 DEEPSTALL_STAGE_FLY_TO_ARC = 3,
868 #[doc = "Turning around back to the deepstall landing point."]
869 DEEPSTALL_STAGE_ARC = 4,
870 #[doc = "Approaching the landing point."]
871 DEEPSTALL_STAGE_APPROACH = 5,
872 #[doc = "Stalling and steering towards the land point."]
873 DEEPSTALL_STAGE_LAND = 6,
874}
875impl DeepstallStage {
876 pub const DEFAULT: Self = Self::DEEPSTALL_STAGE_FLY_TO_LANDING;
877}
878impl Default for DeepstallStage {
879 fn default() -> Self {
880 Self::DEFAULT
881 }
882}
883#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
885#[cfg_attr(feature = "serde", serde(tag = "type"))]
886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
887#[repr(u32)]
888#[doc = "Bus types for device operations."]
889pub enum DeviceOpBustype {
890 #[doc = "I2C Device operation."]
891 DEVICE_OP_BUSTYPE_I2C = 0,
892 #[doc = "SPI Device operation."]
893 DEVICE_OP_BUSTYPE_SPI = 1,
894}
895impl DeviceOpBustype {
896 pub const DEFAULT: Self = Self::DEVICE_OP_BUSTYPE_I2C;
897}
898impl Default for DeviceOpBustype {
899 fn default() -> Self {
900 Self::DEFAULT
901 }
902}
903bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in EKF_STATUS message."] pub struct EkfStatusFlags : u16 { # [doc = "Set if EKF's attitude estimate is good."] const EKF_ATTITUDE = 1 ; # [doc = "Set if EKF's horizontal velocity estimate is good."] const EKF_VELOCITY_HORIZ = 2 ; # [doc = "Set if EKF's vertical velocity estimate is good."] const EKF_VELOCITY_VERT = 4 ; # [doc = "Set if EKF's horizontal position (relative) estimate is good."] const EKF_POS_HORIZ_REL = 8 ; # [doc = "Set if EKF's horizontal position (absolute) estimate is good."] const EKF_POS_HORIZ_ABS = 16 ; # [doc = "Set if EKF's vertical position (absolute) estimate is good."] const EKF_POS_VERT_ABS = 32 ; # [doc = "Set if EKF's vertical position (above ground) estimate is good."] const EKF_POS_VERT_AGL = 64 ; # [doc = "EKF is in constant position mode and does not know it's absolute or relative position."] const EKF_CONST_POS_MODE = 128 ; # [doc = "Set if EKF's predicted horizontal position (relative) estimate is good."] const EKF_PRED_POS_HORIZ_REL = 256 ; # [doc = "Set if EKF's predicted horizontal position (absolute) estimate is good."] const EKF_PRED_POS_HORIZ_ABS = 512 ; # [doc = "Set if EKF believes the GPS input data is faulty."] const EKF_GPS_GLITCHING = 32768 ; # [doc = "Set if EKF has never been healthy."] const EKF_UNINITIALIZED = 1024 ; } }
904impl EkfStatusFlags {
905 pub const DEFAULT: Self = Self::EKF_ATTITUDE;
906}
907impl Default for EkfStatusFlags {
908 fn default() -> Self {
909 Self::DEFAULT
910 }
911}
912#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
914#[cfg_attr(feature = "serde", serde(tag = "type"))]
915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
916#[repr(u32)]
917#[doc = "Indicates the ESC connection type."]
918pub enum EscConnectionType {
919 #[doc = "Traditional PPM ESC."]
920 ESC_CONNECTION_TYPE_PPM = 0,
921 #[doc = "Serial Bus connected ESC."]
922 ESC_CONNECTION_TYPE_SERIAL = 1,
923 #[doc = "One Shot PPM ESC."]
924 ESC_CONNECTION_TYPE_ONESHOT = 2,
925 #[doc = "I2C ESC."]
926 ESC_CONNECTION_TYPE_I2C = 3,
927 #[doc = "CAN-Bus ESC."]
928 ESC_CONNECTION_TYPE_CAN = 4,
929 #[doc = "DShot ESC."]
930 ESC_CONNECTION_TYPE_DSHOT = 5,
931}
932impl EscConnectionType {
933 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
934}
935impl Default for EscConnectionType {
936 fn default() -> Self {
937 Self::DEFAULT
938 }
939}
940bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
941impl EscFailureFlags {
942 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
943}
944impl Default for EscFailureFlags {
945 fn default() -> Self {
946 Self::DEFAULT
947 }
948}
949bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
950impl EstimatorStatusFlags {
951 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
952}
953impl Default for EstimatorStatusFlags {
954 fn default() -> Self {
955 Self::DEFAULT
956 }
957}
958#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
960#[cfg_attr(feature = "serde", serde(tag = "type"))]
961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
962#[repr(u32)]
963#[doc = "List of possible failure type to inject."]
964pub enum FailureType {
965 #[doc = "No failure injected, used to reset a previous failure."]
966 FAILURE_TYPE_OK = 0,
967 #[doc = "Sets unit off, so completely non-responsive."]
968 FAILURE_TYPE_OFF = 1,
969 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
970 FAILURE_TYPE_STUCK = 2,
971 #[doc = "Unit is reporting complete garbage."]
972 FAILURE_TYPE_GARBAGE = 3,
973 #[doc = "Unit is consistently wrong."]
974 FAILURE_TYPE_WRONG = 4,
975 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
976 FAILURE_TYPE_SLOW = 5,
977 #[doc = "Data of unit is delayed in time."]
978 FAILURE_TYPE_DELAYED = 6,
979 #[doc = "Unit is sometimes working, sometimes not."]
980 FAILURE_TYPE_INTERMITTENT = 7,
981}
982impl FailureType {
983 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
984}
985impl Default for FailureType {
986 fn default() -> Self {
987 Self::DEFAULT
988 }
989}
990#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
992#[cfg_attr(feature = "serde", serde(tag = "type"))]
993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
994#[repr(u32)]
995#[doc = "List of possible units where failures can be injected."]
996pub enum FailureUnit {
997 FAILURE_UNIT_SENSOR_GYRO = 0,
998 FAILURE_UNIT_SENSOR_ACCEL = 1,
999 FAILURE_UNIT_SENSOR_MAG = 2,
1000 FAILURE_UNIT_SENSOR_BARO = 3,
1001 FAILURE_UNIT_SENSOR_GPS = 4,
1002 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
1003 FAILURE_UNIT_SENSOR_VIO = 6,
1004 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
1005 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
1006 FAILURE_UNIT_SYSTEM_BATTERY = 100,
1007 FAILURE_UNIT_SYSTEM_MOTOR = 101,
1008 FAILURE_UNIT_SYSTEM_SERVO = 102,
1009 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
1010 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
1011 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
1012}
1013impl FailureUnit {
1014 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
1015}
1016impl Default for FailureUnit {
1017 fn default() -> Self {
1018 Self::DEFAULT
1019 }
1020}
1021#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1022#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1023#[cfg_attr(feature = "serde", serde(tag = "type"))]
1024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1025#[repr(u32)]
1026pub enum FenceBreach {
1027 #[doc = "No last fence breach"]
1028 FENCE_BREACH_NONE = 0,
1029 #[doc = "Breached minimum altitude"]
1030 FENCE_BREACH_MINALT = 1,
1031 #[doc = "Breached maximum altitude"]
1032 FENCE_BREACH_MAXALT = 2,
1033 #[doc = "Breached fence boundary"]
1034 FENCE_BREACH_BOUNDARY = 3,
1035}
1036impl FenceBreach {
1037 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
1038}
1039impl Default for FenceBreach {
1040 fn default() -> Self {
1041 Self::DEFAULT
1042 }
1043}
1044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1046#[cfg_attr(feature = "serde", serde(tag = "type"))]
1047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1048#[repr(u32)]
1049#[doc = "Actions being taken to mitigate/prevent fence breach"]
1050pub enum FenceMitigate {
1051 #[doc = "Unknown"]
1052 FENCE_MITIGATE_UNKNOWN = 0,
1053 #[doc = "No actions being taken"]
1054 FENCE_MITIGATE_NONE = 1,
1055 #[doc = "Velocity limiting active to prevent breach"]
1056 FENCE_MITIGATE_VEL_LIMIT = 2,
1057}
1058impl FenceMitigate {
1059 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
1060}
1061impl Default for FenceMitigate {
1062 fn default() -> Self {
1063 Self::DEFAULT
1064 }
1065}
1066#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1068#[cfg_attr(feature = "serde", serde(tag = "type"))]
1069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1070#[repr(u32)]
1071#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
1072pub enum FenceType {
1073 #[doc = "Maximum altitude fence"]
1074 FENCE_TYPE_ALT_MAX = 1,
1075 #[doc = "Circle fence"]
1076 FENCE_TYPE_CIRCLE = 2,
1077 #[doc = "Polygon fence"]
1078 FENCE_TYPE_POLYGON = 4,
1079 #[doc = "Minimum altitude fence"]
1080 FENCE_TYPE_ALT_MIN = 8,
1081}
1082impl FenceType {
1083 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
1084}
1085impl Default for FenceType {
1086 fn default() -> Self {
1087 Self::DEFAULT
1088 }
1089}
1090#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1092#[cfg_attr(feature = "serde", serde(tag = "type"))]
1093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1094#[repr(u32)]
1095#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
1096pub enum FirmwareVersionType {
1097 #[doc = "development release"]
1098 FIRMWARE_VERSION_TYPE_DEV = 0,
1099 #[doc = "alpha release"]
1100 FIRMWARE_VERSION_TYPE_ALPHA = 64,
1101 #[doc = "beta release"]
1102 FIRMWARE_VERSION_TYPE_BETA = 128,
1103 #[doc = "release candidate"]
1104 FIRMWARE_VERSION_TYPE_RC = 192,
1105 #[doc = "official stable release"]
1106 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
1107}
1108impl FirmwareVersionType {
1109 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
1110}
1111impl Default for FirmwareVersionType {
1112 fn default() -> Self {
1113 Self::DEFAULT
1114 }
1115}
1116#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1118#[cfg_attr(feature = "serde", serde(tag = "type"))]
1119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1120#[repr(u32)]
1121pub enum GimbalAxis {
1122 #[doc = "Gimbal yaw axis."]
1123 GIMBAL_AXIS_YAW = 0,
1124 #[doc = "Gimbal pitch axis."]
1125 GIMBAL_AXIS_PITCH = 1,
1126 #[doc = "Gimbal roll axis."]
1127 GIMBAL_AXIS_ROLL = 2,
1128}
1129impl GimbalAxis {
1130 pub const DEFAULT: Self = Self::GIMBAL_AXIS_YAW;
1131}
1132impl Default for GimbalAxis {
1133 fn default() -> Self {
1134 Self::DEFAULT
1135 }
1136}
1137#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1139#[cfg_attr(feature = "serde", serde(tag = "type"))]
1140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1141#[repr(u32)]
1142pub enum GimbalAxisCalibrationRequired {
1143 #[doc = "Whether or not this axis requires calibration is unknown at this time."]
1144 GIMBAL_AXIS_CALIBRATION_REQUIRED_UNKNOWN = 0,
1145 #[doc = "This axis requires calibration."]
1146 GIMBAL_AXIS_CALIBRATION_REQUIRED_TRUE = 1,
1147 #[doc = "This axis does not require calibration."]
1148 GIMBAL_AXIS_CALIBRATION_REQUIRED_FALSE = 2,
1149}
1150impl GimbalAxisCalibrationRequired {
1151 pub const DEFAULT: Self = Self::GIMBAL_AXIS_CALIBRATION_REQUIRED_UNKNOWN;
1152}
1153impl Default for GimbalAxisCalibrationRequired {
1154 fn default() -> Self {
1155 Self::DEFAULT
1156 }
1157}
1158#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1159#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1160#[cfg_attr(feature = "serde", serde(tag = "type"))]
1161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1162#[repr(u32)]
1163pub enum GimbalAxisCalibrationStatus {
1164 #[doc = "Axis calibration is in progress."]
1165 GIMBAL_AXIS_CALIBRATION_STATUS_IN_PROGRESS = 0,
1166 #[doc = "Axis calibration succeeded."]
1167 GIMBAL_AXIS_CALIBRATION_STATUS_SUCCEEDED = 1,
1168 #[doc = "Axis calibration failed."]
1169 GIMBAL_AXIS_CALIBRATION_STATUS_FAILED = 2,
1170}
1171impl GimbalAxisCalibrationStatus {
1172 pub const DEFAULT: Self = Self::GIMBAL_AXIS_CALIBRATION_STATUS_IN_PROGRESS;
1173}
1174impl Default for GimbalAxisCalibrationStatus {
1175 fn default() -> Self {
1176 Self::DEFAULT
1177 }
1178}
1179bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
1180impl GimbalDeviceCapFlags {
1181 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
1182}
1183impl Default for GimbalDeviceCapFlags {
1184 fn default() -> Self {
1185 Self::DEFAULT
1186 }
1187}
1188bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
1189impl GimbalDeviceErrorFlags {
1190 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
1191}
1192impl Default for GimbalDeviceErrorFlags {
1193 fn default() -> Self {
1194 Self::DEFAULT
1195 }
1196}
1197bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
1198impl GimbalDeviceFlags {
1199 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
1200}
1201impl Default for GimbalDeviceFlags {
1202 fn default() -> Self {
1203 Self::DEFAULT
1204 }
1205}
1206bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
1207impl GimbalManagerCapFlags {
1208 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
1209}
1210impl Default for GimbalManagerCapFlags {
1211 fn default() -> Self {
1212 Self::DEFAULT
1213 }
1214}
1215bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
1216impl GimbalManagerFlags {
1217 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1218}
1219impl Default for GimbalManagerFlags {
1220 fn default() -> Self {
1221 Self::DEFAULT
1222 }
1223}
1224#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1226#[cfg_attr(feature = "serde", serde(tag = "type"))]
1227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1228#[repr(u32)]
1229pub enum GoproBurstRate {
1230 #[doc = "3 Shots / 1 Second."]
1231 GOPRO_BURST_RATE_3_IN_1_SECOND = 0,
1232 #[doc = "5 Shots / 1 Second."]
1233 GOPRO_BURST_RATE_5_IN_1_SECOND = 1,
1234 #[doc = "10 Shots / 1 Second."]
1235 GOPRO_BURST_RATE_10_IN_1_SECOND = 2,
1236 #[doc = "10 Shots / 2 Second."]
1237 GOPRO_BURST_RATE_10_IN_2_SECOND = 3,
1238 #[doc = "10 Shots / 3 Second (Hero 4 Only)."]
1239 GOPRO_BURST_RATE_10_IN_3_SECOND = 4,
1240 #[doc = "30 Shots / 1 Second."]
1241 GOPRO_BURST_RATE_30_IN_1_SECOND = 5,
1242 #[doc = "30 Shots / 2 Second."]
1243 GOPRO_BURST_RATE_30_IN_2_SECOND = 6,
1244 #[doc = "30 Shots / 3 Second."]
1245 GOPRO_BURST_RATE_30_IN_3_SECOND = 7,
1246 #[doc = "30 Shots / 6 Second."]
1247 GOPRO_BURST_RATE_30_IN_6_SECOND = 8,
1248}
1249impl GoproBurstRate {
1250 pub const DEFAULT: Self = Self::GOPRO_BURST_RATE_3_IN_1_SECOND;
1251}
1252impl Default for GoproBurstRate {
1253 fn default() -> Self {
1254 Self::DEFAULT
1255 }
1256}
1257#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1259#[cfg_attr(feature = "serde", serde(tag = "type"))]
1260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1261#[repr(u32)]
1262pub enum GoproCaptureMode {
1263 #[doc = "Video mode."]
1264 GOPRO_CAPTURE_MODE_VIDEO = 0,
1265 #[doc = "Photo mode."]
1266 GOPRO_CAPTURE_MODE_PHOTO = 1,
1267 #[doc = "Burst mode, Hero 3+ only."]
1268 GOPRO_CAPTURE_MODE_BURST = 2,
1269 #[doc = "Time lapse mode, Hero 3+ only."]
1270 GOPRO_CAPTURE_MODE_TIME_LAPSE = 3,
1271 #[doc = "Multi shot mode, Hero 4 only."]
1272 GOPRO_CAPTURE_MODE_MULTI_SHOT = 4,
1273 #[doc = "Playback mode, Hero 4 only, silver only except when LCD or HDMI is connected to black."]
1274 GOPRO_CAPTURE_MODE_PLAYBACK = 5,
1275 #[doc = "Playback mode, Hero 4 only."]
1276 GOPRO_CAPTURE_MODE_SETUP = 6,
1277 #[doc = "Mode not yet known."]
1278 GOPRO_CAPTURE_MODE_UNKNOWN = 255,
1279}
1280impl GoproCaptureMode {
1281 pub const DEFAULT: Self = Self::GOPRO_CAPTURE_MODE_VIDEO;
1282}
1283impl Default for GoproCaptureMode {
1284 fn default() -> Self {
1285 Self::DEFAULT
1286 }
1287}
1288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1290#[cfg_attr(feature = "serde", serde(tag = "type"))]
1291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1292#[repr(u32)]
1293pub enum GoproCharging {
1294 #[doc = "Charging disabled."]
1295 GOPRO_CHARGING_DISABLED = 0,
1296 #[doc = "Charging enabled."]
1297 GOPRO_CHARGING_ENABLED = 1,
1298}
1299impl GoproCharging {
1300 pub const DEFAULT: Self = Self::GOPRO_CHARGING_DISABLED;
1301}
1302impl Default for GoproCharging {
1303 fn default() -> Self {
1304 Self::DEFAULT
1305 }
1306}
1307#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1309#[cfg_attr(feature = "serde", serde(tag = "type"))]
1310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1311#[repr(u32)]
1312pub enum GoproCommand {
1313 #[doc = "(Get/Set)."]
1314 GOPRO_COMMAND_POWER = 0,
1315 #[doc = "(Get/Set)."]
1316 GOPRO_COMMAND_CAPTURE_MODE = 1,
1317 #[doc = "(___/Set)."]
1318 GOPRO_COMMAND_SHUTTER = 2,
1319 #[doc = "(Get/___)."]
1320 GOPRO_COMMAND_BATTERY = 3,
1321 #[doc = "(Get/___)."]
1322 GOPRO_COMMAND_MODEL = 4,
1323 #[doc = "(Get/Set)."]
1324 GOPRO_COMMAND_VIDEO_SETTINGS = 5,
1325 #[doc = "(Get/Set)."]
1326 GOPRO_COMMAND_LOW_LIGHT = 6,
1327 #[doc = "(Get/Set)."]
1328 GOPRO_COMMAND_PHOTO_RESOLUTION = 7,
1329 #[doc = "(Get/Set)."]
1330 GOPRO_COMMAND_PHOTO_BURST_RATE = 8,
1331 #[doc = "(Get/Set)."]
1332 GOPRO_COMMAND_PROTUNE = 9,
1333 #[doc = "(Get/Set) Hero 3+ Only."]
1334 GOPRO_COMMAND_PROTUNE_WHITE_BALANCE = 10,
1335 #[doc = "(Get/Set) Hero 3+ Only."]
1336 GOPRO_COMMAND_PROTUNE_COLOUR = 11,
1337 #[doc = "(Get/Set) Hero 3+ Only."]
1338 GOPRO_COMMAND_PROTUNE_GAIN = 12,
1339 #[doc = "(Get/Set) Hero 3+ Only."]
1340 GOPRO_COMMAND_PROTUNE_SHARPNESS = 13,
1341 #[doc = "(Get/Set) Hero 3+ Only."]
1342 GOPRO_COMMAND_PROTUNE_EXPOSURE = 14,
1343 #[doc = "(Get/Set)."]
1344 GOPRO_COMMAND_TIME = 15,
1345 #[doc = "(Get/Set)."]
1346 GOPRO_COMMAND_CHARGING = 16,
1347}
1348impl GoproCommand {
1349 pub const DEFAULT: Self = Self::GOPRO_COMMAND_POWER;
1350}
1351impl Default for GoproCommand {
1352 fn default() -> Self {
1353 Self::DEFAULT
1354 }
1355}
1356#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1358#[cfg_attr(feature = "serde", serde(tag = "type"))]
1359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1360#[repr(u32)]
1361pub enum GoproFieldOfView {
1362 #[doc = "0x00: Wide."]
1363 GOPRO_FIELD_OF_VIEW_WIDE = 0,
1364 #[doc = "0x01: Medium."]
1365 GOPRO_FIELD_OF_VIEW_MEDIUM = 1,
1366 #[doc = "0x02: Narrow."]
1367 GOPRO_FIELD_OF_VIEW_NARROW = 2,
1368}
1369impl GoproFieldOfView {
1370 pub const DEFAULT: Self = Self::GOPRO_FIELD_OF_VIEW_WIDE;
1371}
1372impl Default for GoproFieldOfView {
1373 fn default() -> Self {
1374 Self::DEFAULT
1375 }
1376}
1377#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1379#[cfg_attr(feature = "serde", serde(tag = "type"))]
1380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1381#[repr(u32)]
1382pub enum GoproFrameRate {
1383 #[doc = "12 FPS."]
1384 GOPRO_FRAME_RATE_12 = 0,
1385 #[doc = "15 FPS."]
1386 GOPRO_FRAME_RATE_15 = 1,
1387 #[doc = "24 FPS."]
1388 GOPRO_FRAME_RATE_24 = 2,
1389 #[doc = "25 FPS."]
1390 GOPRO_FRAME_RATE_25 = 3,
1391 #[doc = "30 FPS."]
1392 GOPRO_FRAME_RATE_30 = 4,
1393 #[doc = "48 FPS."]
1394 GOPRO_FRAME_RATE_48 = 5,
1395 #[doc = "50 FPS."]
1396 GOPRO_FRAME_RATE_50 = 6,
1397 #[doc = "60 FPS."]
1398 GOPRO_FRAME_RATE_60 = 7,
1399 #[doc = "80 FPS."]
1400 GOPRO_FRAME_RATE_80 = 8,
1401 #[doc = "90 FPS."]
1402 GOPRO_FRAME_RATE_90 = 9,
1403 #[doc = "100 FPS."]
1404 GOPRO_FRAME_RATE_100 = 10,
1405 #[doc = "120 FPS."]
1406 GOPRO_FRAME_RATE_120 = 11,
1407 #[doc = "240 FPS."]
1408 GOPRO_FRAME_RATE_240 = 12,
1409 #[doc = "12.5 FPS."]
1410 GOPRO_FRAME_RATE_12_5 = 13,
1411}
1412impl GoproFrameRate {
1413 pub const DEFAULT: Self = Self::GOPRO_FRAME_RATE_12;
1414}
1415impl Default for GoproFrameRate {
1416 fn default() -> Self {
1417 Self::DEFAULT
1418 }
1419}
1420bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GoproHeartbeatFlags : u8 { # [doc = "GoPro is currently recording."] const GOPRO_FLAG_RECORDING = 1 ; } }
1421impl GoproHeartbeatFlags {
1422 pub const DEFAULT: Self = Self::GOPRO_FLAG_RECORDING;
1423}
1424impl Default for GoproHeartbeatFlags {
1425 fn default() -> Self {
1426 Self::DEFAULT
1427 }
1428}
1429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1431#[cfg_attr(feature = "serde", serde(tag = "type"))]
1432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1433#[repr(u32)]
1434pub enum GoproHeartbeatStatus {
1435 #[doc = "No GoPro connected."]
1436 GOPRO_HEARTBEAT_STATUS_DISCONNECTED = 0,
1437 #[doc = "The detected GoPro is not HeroBus compatible."]
1438 GOPRO_HEARTBEAT_STATUS_INCOMPATIBLE = 1,
1439 #[doc = "A HeroBus compatible GoPro is connected."]
1440 GOPRO_HEARTBEAT_STATUS_CONNECTED = 2,
1441 #[doc = "An unrecoverable error was encountered with the connected GoPro, it may require a power cycle."]
1442 GOPRO_HEARTBEAT_STATUS_ERROR = 3,
1443}
1444impl GoproHeartbeatStatus {
1445 pub const DEFAULT: Self = Self::GOPRO_HEARTBEAT_STATUS_DISCONNECTED;
1446}
1447impl Default for GoproHeartbeatStatus {
1448 fn default() -> Self {
1449 Self::DEFAULT
1450 }
1451}
1452#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1454#[cfg_attr(feature = "serde", serde(tag = "type"))]
1455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1456#[repr(u32)]
1457pub enum GoproModel {
1458 #[doc = "Unknown gopro model."]
1459 GOPRO_MODEL_UNKNOWN = 0,
1460 #[doc = "Hero 3+ Silver (HeroBus not supported by GoPro)."]
1461 GOPRO_MODEL_HERO_3_PLUS_SILVER = 1,
1462 #[doc = "Hero 3+ Black."]
1463 GOPRO_MODEL_HERO_3_PLUS_BLACK = 2,
1464 #[doc = "Hero 4 Silver."]
1465 GOPRO_MODEL_HERO_4_SILVER = 3,
1466 #[doc = "Hero 4 Black."]
1467 GOPRO_MODEL_HERO_4_BLACK = 4,
1468}
1469impl GoproModel {
1470 pub const DEFAULT: Self = Self::GOPRO_MODEL_UNKNOWN;
1471}
1472impl Default for GoproModel {
1473 fn default() -> Self {
1474 Self::DEFAULT
1475 }
1476}
1477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1479#[cfg_attr(feature = "serde", serde(tag = "type"))]
1480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1481#[repr(u32)]
1482pub enum GoproPhotoResolution {
1483 #[doc = "5MP Medium."]
1484 GOPRO_PHOTO_RESOLUTION_5MP_MEDIUM = 0,
1485 #[doc = "7MP Medium."]
1486 GOPRO_PHOTO_RESOLUTION_7MP_MEDIUM = 1,
1487 #[doc = "7MP Wide."]
1488 GOPRO_PHOTO_RESOLUTION_7MP_WIDE = 2,
1489 #[doc = "10MP Wide."]
1490 GOPRO_PHOTO_RESOLUTION_10MP_WIDE = 3,
1491 #[doc = "12MP Wide."]
1492 GOPRO_PHOTO_RESOLUTION_12MP_WIDE = 4,
1493}
1494impl GoproPhotoResolution {
1495 pub const DEFAULT: Self = Self::GOPRO_PHOTO_RESOLUTION_5MP_MEDIUM;
1496}
1497impl Default for GoproPhotoResolution {
1498 fn default() -> Self {
1499 Self::DEFAULT
1500 }
1501}
1502#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1504#[cfg_attr(feature = "serde", serde(tag = "type"))]
1505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1506#[repr(u32)]
1507pub enum GoproProtuneColour {
1508 #[doc = "Auto."]
1509 GOPRO_PROTUNE_COLOUR_STANDARD = 0,
1510 #[doc = "Neutral."]
1511 GOPRO_PROTUNE_COLOUR_NEUTRAL = 1,
1512}
1513impl GoproProtuneColour {
1514 pub const DEFAULT: Self = Self::GOPRO_PROTUNE_COLOUR_STANDARD;
1515}
1516impl Default for GoproProtuneColour {
1517 fn default() -> Self {
1518 Self::DEFAULT
1519 }
1520}
1521#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1523#[cfg_attr(feature = "serde", serde(tag = "type"))]
1524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1525#[repr(u32)]
1526pub enum GoproProtuneExposure {
1527 #[doc = "-5.0 EV (Hero 3+ Only)."]
1528 GOPRO_PROTUNE_EXPOSURE_NEG_5_0 = 0,
1529 #[doc = "-4.5 EV (Hero 3+ Only)."]
1530 GOPRO_PROTUNE_EXPOSURE_NEG_4_5 = 1,
1531 #[doc = "-4.0 EV (Hero 3+ Only)."]
1532 GOPRO_PROTUNE_EXPOSURE_NEG_4_0 = 2,
1533 #[doc = "-3.5 EV (Hero 3+ Only)."]
1534 GOPRO_PROTUNE_EXPOSURE_NEG_3_5 = 3,
1535 #[doc = "-3.0 EV (Hero 3+ Only)."]
1536 GOPRO_PROTUNE_EXPOSURE_NEG_3_0 = 4,
1537 #[doc = "-2.5 EV (Hero 3+ Only)."]
1538 GOPRO_PROTUNE_EXPOSURE_NEG_2_5 = 5,
1539 #[doc = "-2.0 EV."]
1540 GOPRO_PROTUNE_EXPOSURE_NEG_2_0 = 6,
1541 #[doc = "-1.5 EV."]
1542 GOPRO_PROTUNE_EXPOSURE_NEG_1_5 = 7,
1543 #[doc = "-1.0 EV."]
1544 GOPRO_PROTUNE_EXPOSURE_NEG_1_0 = 8,
1545 #[doc = "-0.5 EV."]
1546 GOPRO_PROTUNE_EXPOSURE_NEG_0_5 = 9,
1547 #[doc = "0.0 EV."]
1548 GOPRO_PROTUNE_EXPOSURE_ZERO = 10,
1549 #[doc = "+0.5 EV."]
1550 GOPRO_PROTUNE_EXPOSURE_POS_0_5 = 11,
1551 #[doc = "+1.0 EV."]
1552 GOPRO_PROTUNE_EXPOSURE_POS_1_0 = 12,
1553 #[doc = "+1.5 EV."]
1554 GOPRO_PROTUNE_EXPOSURE_POS_1_5 = 13,
1555 #[doc = "+2.0 EV."]
1556 GOPRO_PROTUNE_EXPOSURE_POS_2_0 = 14,
1557 #[doc = "+2.5 EV (Hero 3+ Only)."]
1558 GOPRO_PROTUNE_EXPOSURE_POS_2_5 = 15,
1559 #[doc = "+3.0 EV (Hero 3+ Only)."]
1560 GOPRO_PROTUNE_EXPOSURE_POS_3_0 = 16,
1561 #[doc = "+3.5 EV (Hero 3+ Only)."]
1562 GOPRO_PROTUNE_EXPOSURE_POS_3_5 = 17,
1563 #[doc = "+4.0 EV (Hero 3+ Only)."]
1564 GOPRO_PROTUNE_EXPOSURE_POS_4_0 = 18,
1565 #[doc = "+4.5 EV (Hero 3+ Only)."]
1566 GOPRO_PROTUNE_EXPOSURE_POS_4_5 = 19,
1567 #[doc = "+5.0 EV (Hero 3+ Only)."]
1568 GOPRO_PROTUNE_EXPOSURE_POS_5_0 = 20,
1569}
1570impl GoproProtuneExposure {
1571 pub const DEFAULT: Self = Self::GOPRO_PROTUNE_EXPOSURE_NEG_5_0;
1572}
1573impl Default for GoproProtuneExposure {
1574 fn default() -> Self {
1575 Self::DEFAULT
1576 }
1577}
1578#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1580#[cfg_attr(feature = "serde", serde(tag = "type"))]
1581#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1582#[repr(u32)]
1583pub enum GoproProtuneGain {
1584 #[doc = "ISO 400."]
1585 GOPRO_PROTUNE_GAIN_400 = 0,
1586 #[doc = "ISO 800 (Only Hero 4)."]
1587 GOPRO_PROTUNE_GAIN_800 = 1,
1588 #[doc = "ISO 1600."]
1589 GOPRO_PROTUNE_GAIN_1600 = 2,
1590 #[doc = "ISO 3200 (Only Hero 4)."]
1591 GOPRO_PROTUNE_GAIN_3200 = 3,
1592 #[doc = "ISO 6400."]
1593 GOPRO_PROTUNE_GAIN_6400 = 4,
1594}
1595impl GoproProtuneGain {
1596 pub const DEFAULT: Self = Self::GOPRO_PROTUNE_GAIN_400;
1597}
1598impl Default for GoproProtuneGain {
1599 fn default() -> Self {
1600 Self::DEFAULT
1601 }
1602}
1603#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1605#[cfg_attr(feature = "serde", serde(tag = "type"))]
1606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1607#[repr(u32)]
1608pub enum GoproProtuneSharpness {
1609 #[doc = "Low Sharpness."]
1610 GOPRO_PROTUNE_SHARPNESS_LOW = 0,
1611 #[doc = "Medium Sharpness."]
1612 GOPRO_PROTUNE_SHARPNESS_MEDIUM = 1,
1613 #[doc = "High Sharpness."]
1614 GOPRO_PROTUNE_SHARPNESS_HIGH = 2,
1615}
1616impl GoproProtuneSharpness {
1617 pub const DEFAULT: Self = Self::GOPRO_PROTUNE_SHARPNESS_LOW;
1618}
1619impl Default for GoproProtuneSharpness {
1620 fn default() -> Self {
1621 Self::DEFAULT
1622 }
1623}
1624#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1626#[cfg_attr(feature = "serde", serde(tag = "type"))]
1627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1628#[repr(u32)]
1629pub enum GoproProtuneWhiteBalance {
1630 #[doc = "Auto."]
1631 GOPRO_PROTUNE_WHITE_BALANCE_AUTO = 0,
1632 #[doc = "3000K."]
1633 GOPRO_PROTUNE_WHITE_BALANCE_3000K = 1,
1634 #[doc = "5500K."]
1635 GOPRO_PROTUNE_WHITE_BALANCE_5500K = 2,
1636 #[doc = "6500K."]
1637 GOPRO_PROTUNE_WHITE_BALANCE_6500K = 3,
1638 #[doc = "Camera Raw."]
1639 GOPRO_PROTUNE_WHITE_BALANCE_RAW = 4,
1640}
1641impl GoproProtuneWhiteBalance {
1642 pub const DEFAULT: Self = Self::GOPRO_PROTUNE_WHITE_BALANCE_AUTO;
1643}
1644impl Default for GoproProtuneWhiteBalance {
1645 fn default() -> Self {
1646 Self::DEFAULT
1647 }
1648}
1649#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1651#[cfg_attr(feature = "serde", serde(tag = "type"))]
1652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1653#[repr(u32)]
1654pub enum GoproRequestStatus {
1655 #[doc = "The write message with ID indicated succeeded."]
1656 GOPRO_REQUEST_SUCCESS = 0,
1657 #[doc = "The write message with ID indicated failed."]
1658 GOPRO_REQUEST_FAILED = 1,
1659}
1660impl GoproRequestStatus {
1661 pub const DEFAULT: Self = Self::GOPRO_REQUEST_SUCCESS;
1662}
1663impl Default for GoproRequestStatus {
1664 fn default() -> Self {
1665 Self::DEFAULT
1666 }
1667}
1668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1670#[cfg_attr(feature = "serde", serde(tag = "type"))]
1671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1672#[repr(u32)]
1673pub enum GoproResolution {
1674 #[doc = "848 x 480 (480p)."]
1675 GOPRO_RESOLUTION_480p = 0,
1676 #[doc = "1280 x 720 (720p)."]
1677 GOPRO_RESOLUTION_720p = 1,
1678 #[doc = "1280 x 960 (960p)."]
1679 GOPRO_RESOLUTION_960p = 2,
1680 #[doc = "1920 x 1080 (1080p)."]
1681 GOPRO_RESOLUTION_1080p = 3,
1682 #[doc = "1920 x 1440 (1440p)."]
1683 GOPRO_RESOLUTION_1440p = 4,
1684 #[doc = "2704 x 1440 (2.7k-17:9)."]
1685 GOPRO_RESOLUTION_2_7k_17_9 = 5,
1686 #[doc = "2704 x 1524 (2.7k-16:9)."]
1687 GOPRO_RESOLUTION_2_7k_16_9 = 6,
1688 #[doc = "2704 x 2028 (2.7k-4:3)."]
1689 GOPRO_RESOLUTION_2_7k_4_3 = 7,
1690 #[doc = "3840 x 2160 (4k-16:9)."]
1691 GOPRO_RESOLUTION_4k_16_9 = 8,
1692 #[doc = "4096 x 2160 (4k-17:9)."]
1693 GOPRO_RESOLUTION_4k_17_9 = 9,
1694 #[doc = "1280 x 720 (720p-SuperView)."]
1695 GOPRO_RESOLUTION_720p_SUPERVIEW = 10,
1696 #[doc = "1920 x 1080 (1080p-SuperView)."]
1697 GOPRO_RESOLUTION_1080p_SUPERVIEW = 11,
1698 #[doc = "2704 x 1520 (2.7k-SuperView)."]
1699 GOPRO_RESOLUTION_2_7k_SUPERVIEW = 12,
1700 #[doc = "3840 x 2160 (4k-SuperView)."]
1701 GOPRO_RESOLUTION_4k_SUPERVIEW = 13,
1702}
1703impl GoproResolution {
1704 pub const DEFAULT: Self = Self::GOPRO_RESOLUTION_480p;
1705}
1706impl Default for GoproResolution {
1707 fn default() -> Self {
1708 Self::DEFAULT
1709 }
1710}
1711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1713#[cfg_attr(feature = "serde", serde(tag = "type"))]
1714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1715#[repr(u32)]
1716pub enum GoproVideoSettingsFlags {
1717 #[doc = "0=NTSC, 1=PAL."]
1718 GOPRO_VIDEO_SETTINGS_TV_MODE = 1,
1719}
1720impl GoproVideoSettingsFlags {
1721 pub const DEFAULT: Self = Self::GOPRO_VIDEO_SETTINGS_TV_MODE;
1722}
1723impl Default for GoproVideoSettingsFlags {
1724 fn default() -> Self {
1725 Self::DEFAULT
1726 }
1727}
1728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1730#[cfg_attr(feature = "serde", serde(tag = "type"))]
1731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1732#[repr(u32)]
1733#[doc = "Type of GPS fix"]
1734pub enum GpsFixType {
1735 #[doc = "No GPS connected"]
1736 GPS_FIX_TYPE_NO_GPS = 0,
1737 #[doc = "No position information, GPS is connected"]
1738 GPS_FIX_TYPE_NO_FIX = 1,
1739 #[doc = "2D position"]
1740 GPS_FIX_TYPE_2D_FIX = 2,
1741 #[doc = "3D position"]
1742 GPS_FIX_TYPE_3D_FIX = 3,
1743 #[doc = "DGPS/SBAS aided 3D position"]
1744 GPS_FIX_TYPE_DGPS = 4,
1745 #[doc = "RTK float, 3D position"]
1746 GPS_FIX_TYPE_RTK_FLOAT = 5,
1747 #[doc = "RTK Fixed, 3D position"]
1748 GPS_FIX_TYPE_RTK_FIXED = 6,
1749 #[doc = "Static fixed, typically used for base stations"]
1750 GPS_FIX_TYPE_STATIC = 7,
1751 #[doc = "PPP, 3D position."]
1752 GPS_FIX_TYPE_PPP = 8,
1753}
1754impl GpsFixType {
1755 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1756}
1757impl Default for GpsFixType {
1758 fn default() -> Self {
1759 Self::DEFAULT
1760 }
1761}
1762bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1763impl GpsInputIgnoreFlags {
1764 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1765}
1766impl Default for GpsInputIgnoreFlags {
1767 fn default() -> Self {
1768 Self::DEFAULT
1769 }
1770}
1771#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1773#[cfg_attr(feature = "serde", serde(tag = "type"))]
1774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1775#[repr(u32)]
1776#[doc = "Gripper actions."]
1777pub enum GripperActions {
1778 #[doc = "Gripper release cargo."]
1779 GRIPPER_ACTION_RELEASE = 0,
1780 #[doc = "Gripper grab onto cargo."]
1781 GRIPPER_ACTION_GRAB = 1,
1782}
1783impl GripperActions {
1784 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1785}
1786impl Default for GripperActions {
1787 fn default() -> Self {
1788 Self::DEFAULT
1789 }
1790}
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796pub enum HeadingType {
1797 HEADING_TYPE_COURSE_OVER_GROUND = 0,
1798 HEADING_TYPE_HEADING = 1,
1799 HEADING_TYPE_DEFAULT = 2,
1800}
1801impl HeadingType {
1802 pub const DEFAULT: Self = Self::HEADING_TYPE_COURSE_OVER_GROUND;
1803}
1804impl Default for HeadingType {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1810impl HighresImuUpdatedFlags {
1811 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1812}
1813impl Default for HighresImuUpdatedFlags {
1814 fn default() -> Self {
1815 Self::DEFAULT
1816 }
1817}
1818bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1819impl HilActuatorControlsFlags {
1820 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1821}
1822impl Default for HilActuatorControlsFlags {
1823 fn default() -> Self {
1824 Self::DEFAULT
1825 }
1826}
1827bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1828impl HilSensorUpdatedFlags {
1829 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1830}
1831impl Default for HilSensorUpdatedFlags {
1832 fn default() -> Self {
1833 Self::DEFAULT
1834 }
1835}
1836bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1837impl HlFailureFlag {
1838 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1839}
1840impl Default for HlFailureFlag {
1841 fn default() -> Self {
1842 Self::DEFAULT
1843 }
1844}
1845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1847#[cfg_attr(feature = "serde", serde(tag = "type"))]
1848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1849#[repr(u32)]
1850pub enum IcarousFmsState {
1851 ICAROUS_FMS_STATE_IDLE = 0,
1852 ICAROUS_FMS_STATE_TAKEOFF = 1,
1853 ICAROUS_FMS_STATE_CLIMB = 2,
1854 ICAROUS_FMS_STATE_CRUISE = 3,
1855 ICAROUS_FMS_STATE_APPROACH = 4,
1856 ICAROUS_FMS_STATE_LAND = 5,
1857}
1858impl IcarousFmsState {
1859 pub const DEFAULT: Self = Self::ICAROUS_FMS_STATE_IDLE;
1860}
1861impl Default for IcarousFmsState {
1862 fn default() -> Self {
1863 Self::DEFAULT
1864 }
1865}
1866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1868#[cfg_attr(feature = "serde", serde(tag = "type"))]
1869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1870#[repr(u32)]
1871pub enum IcarousTrackBandTypes {
1872 ICAROUS_TRACK_BAND_TYPE_NONE = 0,
1873 ICAROUS_TRACK_BAND_TYPE_NEAR = 1,
1874 ICAROUS_TRACK_BAND_TYPE_RECOVERY = 2,
1875}
1876impl IcarousTrackBandTypes {
1877 pub const DEFAULT: Self = Self::ICAROUS_TRACK_BAND_TYPE_NONE;
1878}
1879impl Default for IcarousTrackBandTypes {
1880 fn default() -> Self {
1881 Self::DEFAULT
1882 }
1883}
1884bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1885impl IlluminatorErrorFlags {
1886 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1887}
1888impl Default for IlluminatorErrorFlags {
1889 fn default() -> Self {
1890 Self::DEFAULT
1891 }
1892}
1893#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1894#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1895#[cfg_attr(feature = "serde", serde(tag = "type"))]
1896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1897#[repr(u32)]
1898#[doc = "Modes of illuminator"]
1899pub enum IlluminatorMode {
1900 #[doc = "Illuminator mode is not specified/unknown"]
1901 ILLUMINATOR_MODE_UNKNOWN = 0,
1902 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1903 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1904 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1905 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1906}
1907impl IlluminatorMode {
1908 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1909}
1910impl Default for IlluminatorMode {
1911 fn default() -> Self {
1912 Self::DEFAULT
1913 }
1914}
1915#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1917#[cfg_attr(feature = "serde", serde(tag = "type"))]
1918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1919#[repr(u32)]
1920#[doc = "Type of landing target"]
1921pub enum LandingTargetType {
1922 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1923 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1924 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1925 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1926 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1927 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1928 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1929 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1930}
1931impl LandingTargetType {
1932 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1933}
1934impl Default for LandingTargetType {
1935 fn default() -> Self {
1936 Self::DEFAULT
1937 }
1938}
1939#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1941#[cfg_attr(feature = "serde", serde(tag = "type"))]
1942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1943#[repr(u32)]
1944pub enum LedControlPattern {
1945 #[doc = "LED patterns off (return control to regular vehicle control)."]
1946 LED_CONTROL_PATTERN_OFF = 0,
1947 #[doc = "LEDs show pattern during firmware update."]
1948 LED_CONTROL_PATTERN_FIRMWAREUPDATE = 1,
1949 #[doc = "Custom Pattern using custom bytes fields."]
1950 LED_CONTROL_PATTERN_CUSTOM = 255,
1951}
1952impl LedControlPattern {
1953 pub const DEFAULT: Self = Self::LED_CONTROL_PATTERN_OFF;
1954}
1955impl Default for LedControlPattern {
1956 fn default() -> Self {
1957 Self::DEFAULT
1958 }
1959}
1960bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct LimitModule : u8 { # [doc = "Pre-initialization."] const LIMIT_GPSLOCK = 1 ; # [doc = "Disabled."] const LIMIT_GEOFENCE = 2 ; # [doc = "Checking limits."] const LIMIT_ALTITUDE = 4 ; } }
1961impl LimitModule {
1962 pub const DEFAULT: Self = Self::LIMIT_GPSLOCK;
1963}
1964impl Default for LimitModule {
1965 fn default() -> Self {
1966 Self::DEFAULT
1967 }
1968}
1969#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1971#[cfg_attr(feature = "serde", serde(tag = "type"))]
1972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1973#[repr(u32)]
1974pub enum LimitsState {
1975 #[doc = "Pre-initialization."]
1976 LIMITS_INIT = 0,
1977 #[doc = "Disabled."]
1978 LIMITS_DISABLED = 1,
1979 #[doc = "Checking limits."]
1980 LIMITS_ENABLED = 2,
1981 #[doc = "A limit has been breached."]
1982 LIMITS_TRIGGERED = 3,
1983 #[doc = "Taking action e.g. Return/RTL."]
1984 LIMITS_RECOVERING = 4,
1985 #[doc = "We're no longer in breach of a limit."]
1986 LIMITS_RECOVERED = 5,
1987}
1988impl LimitsState {
1989 pub const DEFAULT: Self = Self::LIMITS_INIT;
1990}
1991impl Default for LimitsState {
1992 fn default() -> Self {
1993 Self::DEFAULT
1994 }
1995}
1996#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1997#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1998#[cfg_attr(feature = "serde", serde(tag = "type"))]
1999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2000#[repr(u32)]
2001pub enum MagCalStatus {
2002 MAG_CAL_NOT_STARTED = 0,
2003 MAG_CAL_WAITING_TO_START = 1,
2004 MAG_CAL_RUNNING_STEP_ONE = 2,
2005 MAG_CAL_RUNNING_STEP_TWO = 3,
2006 MAG_CAL_SUCCESS = 4,
2007 MAG_CAL_FAILED = 5,
2008 MAG_CAL_BAD_ORIENTATION = 6,
2009 MAG_CAL_BAD_RADIUS = 7,
2010}
2011impl MagCalStatus {
2012 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
2013}
2014impl Default for MagCalStatus {
2015 fn default() -> Self {
2016 Self::DEFAULT
2017 }
2018}
2019#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2021#[cfg_attr(feature = "serde", serde(tag = "type"))]
2022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2023#[repr(u32)]
2024pub enum MavArmAuthDeniedReason {
2025 #[doc = "Not a specific reason"]
2026 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
2027 #[doc = "Authorizer will send the error as string to GCS"]
2028 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
2029 #[doc = "At least one waypoint have a invalid value"]
2030 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
2031 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
2032 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
2033 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
2034 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
2035 #[doc = "Weather is not good to fly"]
2036 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
2037}
2038impl MavArmAuthDeniedReason {
2039 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
2040}
2041impl Default for MavArmAuthDeniedReason {
2042 fn default() -> Self {
2043 Self::DEFAULT
2044 }
2045}
2046#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2048#[cfg_attr(feature = "serde", serde(tag = "type"))]
2049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2050#[repr(u32)]
2051#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
2052pub enum MavAutopilot {
2053 #[doc = "Generic autopilot, full support for everything"]
2054 MAV_AUTOPILOT_GENERIC = 0,
2055 #[doc = "Reserved for future use."]
2056 MAV_AUTOPILOT_RESERVED = 1,
2057 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
2058 MAV_AUTOPILOT_SLUGS = 2,
2059 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
2060 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
2061 #[doc = "OpenPilot, <http://openpilot.org>"]
2062 MAV_AUTOPILOT_OPENPILOT = 4,
2063 #[doc = "Generic autopilot only supporting simple waypoints"]
2064 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
2065 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
2066 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
2067 #[doc = "Generic autopilot supporting the full mission command set"]
2068 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
2069 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
2070 MAV_AUTOPILOT_INVALID = 8,
2071 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
2072 MAV_AUTOPILOT_PPZ = 9,
2073 #[doc = "UAV Dev Board"]
2074 MAV_AUTOPILOT_UDB = 10,
2075 #[doc = "FlexiPilot"]
2076 MAV_AUTOPILOT_FP = 11,
2077 #[doc = "PX4 Autopilot - <http://px4.io/>"]
2078 MAV_AUTOPILOT_PX4 = 12,
2079 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
2080 MAV_AUTOPILOT_SMACCMPILOT = 13,
2081 #[doc = "AutoQuad -- <http://autoquad.org>"]
2082 MAV_AUTOPILOT_AUTOQUAD = 14,
2083 #[doc = "Armazila -- <http://armazila.com>"]
2084 MAV_AUTOPILOT_ARMAZILA = 15,
2085 #[doc = "Aerob -- <http://aerob.ru>"]
2086 MAV_AUTOPILOT_AEROB = 16,
2087 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
2088 MAV_AUTOPILOT_ASLUAV = 17,
2089 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
2090 MAV_AUTOPILOT_SMARTAP = 18,
2091 #[doc = "AirRails - <http://uaventure.com>"]
2092 MAV_AUTOPILOT_AIRRAILS = 19,
2093 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
2094 MAV_AUTOPILOT_REFLEX = 20,
2095}
2096impl MavAutopilot {
2097 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
2098}
2099impl Default for MavAutopilot {
2100 fn default() -> Self {
2101 Self::DEFAULT
2102 }
2103}
2104#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2106#[cfg_attr(feature = "serde", serde(tag = "type"))]
2107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2108#[repr(u32)]
2109#[doc = "Enumeration for battery charge states."]
2110pub enum MavBatteryChargeState {
2111 #[doc = "Low battery state is not provided"]
2112 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
2113 #[doc = "Battery is not in low state. Normal operation."]
2114 MAV_BATTERY_CHARGE_STATE_OK = 1,
2115 #[doc = "Battery state is low, warn and monitor close."]
2116 MAV_BATTERY_CHARGE_STATE_LOW = 2,
2117 #[doc = "Battery state is critical, return or abort immediately."]
2118 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
2119 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
2120 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
2121 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
2122 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
2123 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
2124 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
2125 #[doc = "Battery is charging."]
2126 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
2127}
2128impl MavBatteryChargeState {
2129 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
2130}
2131impl Default for MavBatteryChargeState {
2132 fn default() -> Self {
2133 Self::DEFAULT
2134 }
2135}
2136bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
2137impl MavBatteryFault {
2138 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
2139}
2140impl Default for MavBatteryFault {
2141 fn default() -> Self {
2142 Self::DEFAULT
2143 }
2144}
2145#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2147#[cfg_attr(feature = "serde", serde(tag = "type"))]
2148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2149#[repr(u32)]
2150#[doc = "Enumeration of battery functions"]
2151pub enum MavBatteryFunction {
2152 #[doc = "Battery function is unknown"]
2153 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
2154 #[doc = "Battery supports all flight systems"]
2155 MAV_BATTERY_FUNCTION_ALL = 1,
2156 #[doc = "Battery for the propulsion system"]
2157 MAV_BATTERY_FUNCTION_PROPULSION = 2,
2158 #[doc = "Avionics battery"]
2159 MAV_BATTERY_FUNCTION_AVIONICS = 3,
2160 #[doc = "Payload battery"]
2161 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
2162}
2163impl MavBatteryFunction {
2164 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
2165}
2166impl Default for MavBatteryFunction {
2167 fn default() -> Self {
2168 Self::DEFAULT
2169 }
2170}
2171#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2173#[cfg_attr(feature = "serde", serde(tag = "type"))]
2174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2175#[repr(u32)]
2176#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
2177pub enum MavBatteryMode {
2178 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
2179 MAV_BATTERY_MODE_UNKNOWN = 0,
2180 #[doc = "Battery is auto discharging (towards storage level)."]
2181 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
2182 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
2183 MAV_BATTERY_MODE_HOT_SWAP = 2,
2184}
2185impl MavBatteryMode {
2186 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
2187}
2188impl Default for MavBatteryMode {
2189 fn default() -> Self {
2190 Self::DEFAULT
2191 }
2192}
2193#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2195#[cfg_attr(feature = "serde", serde(tag = "type"))]
2196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2197#[repr(u32)]
2198#[doc = "Enumeration of battery types"]
2199pub enum MavBatteryType {
2200 #[doc = "Not specified."]
2201 MAV_BATTERY_TYPE_UNKNOWN = 0,
2202 #[doc = "Lithium polymer battery"]
2203 MAV_BATTERY_TYPE_LIPO = 1,
2204 #[doc = "Lithium-iron-phosphate battery"]
2205 MAV_BATTERY_TYPE_LIFE = 2,
2206 #[doc = "Lithium-ION battery"]
2207 MAV_BATTERY_TYPE_LION = 3,
2208 #[doc = "Nickel metal hydride battery"]
2209 MAV_BATTERY_TYPE_NIMH = 4,
2210}
2211impl MavBatteryType {
2212 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
2213}
2214impl Default for MavBatteryType {
2215 fn default() -> Self {
2216 Self::DEFAULT
2217 }
2218}
2219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2221#[cfg_attr(feature = "serde", serde(tag = "type"))]
2222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2223#[repr(u32)]
2224#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
2225pub enum MavCmd {
2226 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
2227 MAV_CMD_NAV_WAYPOINT = 16,
2228 #[doc = "Loiter around this waypoint an unlimited amount of time"]
2229 MAV_CMD_NAV_LOITER_UNLIM = 17,
2230 #[doc = "Loiter around this waypoint for X turns"]
2231 MAV_CMD_NAV_LOITER_TURNS = 18,
2232 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
2233 MAV_CMD_NAV_LOITER_TIME = 19,
2234 #[doc = "Return to launch location"]
2235 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
2236 #[doc = "Land at location."]
2237 MAV_CMD_NAV_LAND = 21,
2238 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
2239 MAV_CMD_NAV_TAKEOFF = 22,
2240 #[doc = "Land at local position (local frame only)"]
2241 MAV_CMD_NAV_LAND_LOCAL = 23,
2242 #[doc = "Takeoff from local position (local frame only)"]
2243 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
2244 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
2245 MAV_CMD_NAV_FOLLOW = 25,
2246 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
2247 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
2248 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
2249 MAV_CMD_NAV_LOITER_TO_ALT = 31,
2250 #[doc = "Begin following a target"]
2251 MAV_CMD_DO_FOLLOW = 32,
2252 #[doc = "Reposition the MAV after a follow target command has been sent"]
2253 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
2254 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
2255 MAV_CMD_DO_ORBIT = 34,
2256 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
2257 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
2258 MAV_CMD_NAV_ROI = 80,
2259 #[doc = "Control autonomous path planning on the MAV."]
2260 MAV_CMD_NAV_PATHPLANNING = 81,
2261 #[doc = "Navigate to waypoint using a spline path."]
2262 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
2263 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
2264 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
2265 #[doc = "Land using VTOL mode"]
2266 MAV_CMD_NAV_VTOL_LAND = 85,
2267 #[doc = "hand control over to an external controller"]
2268 MAV_CMD_NAV_GUIDED_ENABLE = 92,
2269 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
2270 MAV_CMD_NAV_DELAY = 93,
2271 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
2272 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
2273 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
2274 MAV_CMD_NAV_LAST = 95,
2275 #[doc = "Delay mission state machine."]
2276 MAV_CMD_CONDITION_DELAY = 112,
2277 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
2278 MAV_CMD_CONDITION_CHANGE_ALT = 113,
2279 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
2280 MAV_CMD_CONDITION_DISTANCE = 114,
2281 #[doc = "Reach a certain target angle."]
2282 MAV_CMD_CONDITION_YAW = 115,
2283 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
2284 MAV_CMD_CONDITION_LAST = 159,
2285 #[doc = "Set system mode."]
2286 MAV_CMD_DO_SET_MODE = 176,
2287 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
2288 MAV_CMD_DO_JUMP = 177,
2289 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
2290 MAV_CMD_DO_CHANGE_SPEED = 178,
2291 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
2292 MAV_CMD_DO_SET_HOME = 179,
2293 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
2294 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
2295 MAV_CMD_DO_SET_PARAMETER = 180,
2296 #[doc = "Set a relay to a condition."]
2297 MAV_CMD_DO_SET_RELAY = 181,
2298 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
2299 MAV_CMD_DO_REPEAT_RELAY = 182,
2300 #[doc = "Set a servo to a desired PWM value."]
2301 MAV_CMD_DO_SET_SERVO = 183,
2302 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
2303 MAV_CMD_DO_REPEAT_SERVO = 184,
2304 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
2305 MAV_CMD_DO_FLIGHTTERMINATION = 185,
2306 #[doc = "Change altitude set point."]
2307 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
2308 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
2309 MAV_CMD_DO_SET_ACTUATOR = 187,
2310 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
2311 MAV_CMD_DO_RETURN_PATH_START = 188,
2312 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
2313 MAV_CMD_DO_LAND_START = 189,
2314 #[doc = "Mission command to perform a landing from a rally point."]
2315 MAV_CMD_DO_RALLY_LAND = 190,
2316 #[doc = "Mission command to safely abort an autonomous landing."]
2317 MAV_CMD_DO_GO_AROUND = 191,
2318 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
2319 MAV_CMD_DO_REPOSITION = 192,
2320 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
2321 MAV_CMD_DO_PAUSE_CONTINUE = 193,
2322 #[doc = "Set moving direction to forward or reverse."]
2323 MAV_CMD_DO_SET_REVERSE = 194,
2324 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
2325 MAV_CMD_DO_SET_ROI_LOCATION = 195,
2326 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2327 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
2328 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
2329 MAV_CMD_DO_SET_ROI_NONE = 197,
2330 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
2331 MAV_CMD_DO_SET_ROI_SYSID = 198,
2332 #[doc = "Control onboard camera system."]
2333 MAV_CMD_DO_CONTROL_VIDEO = 200,
2334 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
2335 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
2336 MAV_CMD_DO_SET_ROI = 201,
2337 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2338 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
2339 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
2340 MAV_CMD_DO_DIGICAM_CONTROL = 203,
2341 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
2342 #[doc = "Mission command to configure a camera or antenna mount"]
2343 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
2344 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
2345 #[doc = "Mission command to control a camera or antenna mount"]
2346 MAV_CMD_DO_MOUNT_CONTROL = 205,
2347 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
2348 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
2349 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
2350 MAV_CMD_DO_FENCE_ENABLE = 207,
2351 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
2352 MAV_CMD_DO_PARACHUTE = 208,
2353 #[doc = "Command to perform motor test."]
2354 MAV_CMD_DO_MOTOR_TEST = 209,
2355 #[doc = "Change to/from inverted flight."]
2356 MAV_CMD_DO_INVERTED_FLIGHT = 210,
2357 #[doc = "Mission command to operate a gripper."]
2358 MAV_CMD_DO_GRIPPER = 211,
2359 #[doc = "Enable/disable autotune."]
2360 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
2361 #[doc = "Sets a desired vehicle turn angle and speed change."]
2362 MAV_CMD_NAV_SET_YAW_SPEED = 213,
2363 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
2364 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
2365 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
2366 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
2367 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
2368 #[doc = "set id of master controller"]
2369 MAV_CMD_DO_GUIDED_MASTER = 221,
2370 #[doc = "Set limits for external control"]
2371 MAV_CMD_DO_GUIDED_LIMITS = 222,
2372 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
2373 MAV_CMD_DO_ENGINE_CONTROL = 223,
2374 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
2375 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
2376 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
2377 MAV_CMD_DO_LAST = 240,
2378 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
2379 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
2380 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
2381 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
2382 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
2383 MAV_CMD_PREFLIGHT_UAVCAN = 243,
2384 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
2385 MAV_CMD_PREFLIGHT_STORAGE = 245,
2386 #[doc = "Request the reboot or shutdown of system components."]
2387 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
2388 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
2389 MAV_CMD_OVERRIDE_GOTO = 252,
2390 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
2391 MAV_CMD_OBLIQUE_SURVEY = 260,
2392 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
2393 MAV_CMD_DO_SET_STANDARD_MODE = 262,
2394 #[doc = "start running a mission"]
2395 MAV_CMD_MISSION_START = 300,
2396 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
2397 MAV_CMD_ACTUATOR_TEST = 310,
2398 #[doc = "Actuator configuration command."]
2399 MAV_CMD_CONFIGURE_ACTUATOR = 311,
2400 #[doc = "Arms / Disarms a component"]
2401 MAV_CMD_COMPONENT_ARM_DISARM = 400,
2402 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
2403 MAV_CMD_RUN_PREARM_CHECKS = 401,
2404 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2405 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
2406 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
2407 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
2408 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
2409 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
2410 MAV_CMD_GET_HOME_POSITION = 410,
2411 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
2412 MAV_CMD_INJECT_FAILURE = 420,
2413 #[doc = "Starts receiver pairing."]
2414 MAV_CMD_START_RX_PAIR = 500,
2415 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
2416 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
2417 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
2418 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
2419 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
2420 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
2421 MAV_CMD_REQUEST_MESSAGE = 512,
2422 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2423 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
2424 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
2425 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2426 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
2427 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
2428 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2429 #[doc = "Request camera information (CAMERA_INFORMATION)."]
2430 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
2431 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2432 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
2433 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
2434 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2435 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
2436 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
2437 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
2438 MAV_CMD_STORAGE_FORMAT = 526,
2439 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2440 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
2441 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
2442 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2443 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
2444 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
2445 #[doc = "Reset all camera settings to Factory Default"]
2446 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
2447 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
2448 MAV_CMD_SET_CAMERA_MODE = 530,
2449 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2450 MAV_CMD_SET_CAMERA_ZOOM = 531,
2451 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
2452 MAV_CMD_SET_CAMERA_FOCUS = 532,
2453 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
2454 MAV_CMD_SET_STORAGE_USAGE = 533,
2455 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
2456 MAV_CMD_SET_CAMERA_SOURCE = 534,
2457 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
2458 MAV_CMD_JUMP_TAG = 600,
2459 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
2460 MAV_CMD_DO_JUMP_TAG = 601,
2461 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
2462 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
2463 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
2464 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
2465 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2466 MAV_CMD_IMAGE_START_CAPTURE = 2000,
2467 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
2468 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
2469 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2470 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
2471 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
2472 #[doc = "Enable or disable on-board camera triggering system."]
2473 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
2474 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
2475 MAV_CMD_CAMERA_TRACK_POINT = 2004,
2476 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
2477 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
2478 #[doc = "Stops ongoing tracking."]
2479 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
2480 #[doc = "Starts video capture (recording)."]
2481 MAV_CMD_VIDEO_START_CAPTURE = 2500,
2482 #[doc = "Stop the current video capture (recording)."]
2483 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
2484 #[doc = "Start video streaming"]
2485 MAV_CMD_VIDEO_START_STREAMING = 2502,
2486 #[doc = "Stop the given video stream"]
2487 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
2488 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2489 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
2490 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
2491 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
2492 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
2493 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
2494 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
2495 MAV_CMD_LOGGING_START = 2510,
2496 #[doc = "Request to stop streaming log data over MAVLink"]
2497 MAV_CMD_LOGGING_STOP = 2511,
2498 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
2499 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
2500 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
2501 #[doc = "Create a panorama at the current position"]
2502 MAV_CMD_PANORAMA_CREATE = 2800,
2503 #[doc = "Request VTOL transition"]
2504 MAV_CMD_DO_VTOL_TRANSITION = 3000,
2505 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
2506 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
2507 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
2508 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
2509 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
2510 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
2511 #[doc = "Delay mission state machine until gate has been reached."]
2512 MAV_CMD_CONDITION_GATE = 4501,
2513 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
2514 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
2515 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
2516 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
2517 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
2518 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
2519 #[doc = "Circular fence area. The vehicle must stay inside this area."]
2520 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
2521 #[doc = "Circular fence area. The vehicle must stay outside this area."]
2522 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
2523 #[doc = "Rally point. You can have multiple rally points defined."]
2524 MAV_CMD_NAV_RALLY_POINT = 5100,
2525 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
2526 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
2527 #[doc = "Change state of safety switch."]
2528 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
2529 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
2530 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
2531 #[deprecated = " (Deprecated since 2021-06)"]
2532 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
2533 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
2534 #[deprecated = " (Deprecated since 2021-06)"]
2535 #[doc = "Control the payload deployment."]
2536 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
2537 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
2538 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
2539 #[doc = "Command to operate winch."]
2540 MAV_CMD_DO_WINCH = 42600,
2541 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
2542 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
2543 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2544 MAV_CMD_WAYPOINT_USER_1 = 31000,
2545 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2546 MAV_CMD_WAYPOINT_USER_2 = 31001,
2547 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2548 MAV_CMD_WAYPOINT_USER_3 = 31002,
2549 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2550 MAV_CMD_WAYPOINT_USER_4 = 31003,
2551 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
2552 MAV_CMD_WAYPOINT_USER_5 = 31004,
2553 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2554 MAV_CMD_SPATIAL_USER_1 = 31005,
2555 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2556 MAV_CMD_SPATIAL_USER_2 = 31006,
2557 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2558 MAV_CMD_SPATIAL_USER_3 = 31007,
2559 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2560 MAV_CMD_SPATIAL_USER_4 = 31008,
2561 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
2562 MAV_CMD_SPATIAL_USER_5 = 31009,
2563 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2564 MAV_CMD_USER_1 = 31010,
2565 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2566 MAV_CMD_USER_2 = 31011,
2567 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2568 MAV_CMD_USER_3 = 31012,
2569 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2570 MAV_CMD_USER_4 = 31013,
2571 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
2572 MAV_CMD_USER_5 = 31014,
2573 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
2574 MAV_CMD_CAN_FORWARD = 32000,
2575 #[doc = "Set Loweheiser desired states"]
2576 MAV_CMD_LOWEHEISER_SET_STATE = 10151,
2577 #[doc = "Set the distance to be repeated on mission resume"]
2578 MAV_CMD_DO_SET_RESUME_REPEAT_DIST = 215,
2579 #[doc = "Control attached liquid sprayer"]
2580 MAV_CMD_DO_SPRAYER = 216,
2581 #[doc = "Pass instructions onto scripting, a script should be checking for a new command"]
2582 MAV_CMD_DO_SEND_SCRIPT_MESSAGE = 217,
2583 #[doc = "Execute auxiliary function"]
2584 MAV_CMD_DO_AUX_FUNCTION = 218,
2585 #[doc = "Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up."]
2586 MAV_CMD_NAV_ALTITUDE_WAIT = 83,
2587 #[doc = "A system wide power-off event has been initiated."]
2588 MAV_CMD_POWER_OFF_INITIATED = 42000,
2589 #[doc = "FLY button has been clicked."]
2590 MAV_CMD_SOLO_BTN_FLY_CLICK = 42001,
2591 #[doc = "FLY button has been held for 1.5 seconds."]
2592 MAV_CMD_SOLO_BTN_FLY_HOLD = 42002,
2593 #[doc = "PAUSE button has been clicked."]
2594 MAV_CMD_SOLO_BTN_PAUSE_CLICK = 42003,
2595 #[doc = "Magnetometer calibration based on fixed position in earth field given by inclination, declination and intensity."]
2596 MAV_CMD_FIXED_MAG_CAL = 42004,
2597 #[doc = "Magnetometer calibration based on fixed expected field values."]
2598 MAV_CMD_FIXED_MAG_CAL_FIELD = 42005,
2599 #[doc = "Set EKF sensor source set."]
2600 MAV_CMD_SET_EKF_SOURCE_SET = 42007,
2601 #[doc = "Initiate a magnetometer calibration."]
2602 MAV_CMD_DO_START_MAG_CAL = 42424,
2603 #[doc = "Accept a magnetometer calibration."]
2604 MAV_CMD_DO_ACCEPT_MAG_CAL = 42425,
2605 #[doc = "Cancel a running magnetometer calibration."]
2606 MAV_CMD_DO_CANCEL_MAG_CAL = 42426,
2607 #[doc = "Used when doing accelerometer calibration. When sent to the GCS tells it what position to put the vehicle in. When sent to the vehicle says what position the vehicle is in."]
2608 MAV_CMD_ACCELCAL_VEHICLE_POS = 42429,
2609 #[doc = "Reply with the version banner."]
2610 MAV_CMD_DO_SEND_BANNER = 42428,
2611 #[doc = "Command autopilot to get into factory test/diagnostic mode."]
2612 MAV_CMD_SET_FACTORY_TEST_MODE = 42427,
2613 #[doc = "Causes the gimbal to reset and boot as if it was just powered on."]
2614 MAV_CMD_GIMBAL_RESET = 42501,
2615 #[doc = "Reports progress and success or failure of gimbal axis calibration procedure."]
2616 MAV_CMD_GIMBAL_AXIS_CALIBRATION_STATUS = 42502,
2617 #[doc = "Starts commutation calibration on the gimbal."]
2618 MAV_CMD_GIMBAL_REQUEST_AXIS_CALIBRATION = 42503,
2619 #[doc = "Erases gimbal application and parameters."]
2620 MAV_CMD_GIMBAL_FULL_RESET = 42505,
2621 #[doc = "Update the bootloader"]
2622 MAV_CMD_FLASH_BOOTLOADER = 42650,
2623 #[doc = "Reset battery capacity for batteries that accumulate consumed battery via integration."]
2624 MAV_CMD_BATTERY_RESET = 42651,
2625 #[doc = "Issue a trap signal to the autopilot process, presumably to enter the debugger."]
2626 MAV_CMD_DEBUG_TRAP = 42700,
2627 #[doc = "Control onboard scripting."]
2628 MAV_CMD_SCRIPTING = 42701,
2629 #[doc = "Scripting command as NAV command with wait for completion."]
2630 MAV_CMD_NAV_SCRIPT_TIME = 42702,
2631 #[doc = "Maintain an attitude for a specified time."]
2632 MAV_CMD_NAV_ATTITUDE_TIME = 42703,
2633 #[doc = "Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)"]
2634 MAV_CMD_GUIDED_CHANGE_SPEED = 43000,
2635 #[doc = "Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)"]
2636 MAV_CMD_GUIDED_CHANGE_ALTITUDE = 43001,
2637 #[doc = "Change to target heading at a given rate, overriding previous heading/s. This slews the vehicle at a controllable rate between it's previous heading and the new one. (affects GUIDED only. Exiting GUIDED returns aircraft to normal behaviour defined elsewhere. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)"]
2638 MAV_CMD_GUIDED_CHANGE_HEADING = 43002,
2639 #[doc = "Provide a value for height above ground level. This can be used for things like fixed wing and VTOL landing."]
2640 MAV_CMD_SET_HAGL = 43005,
2641}
2642impl MavCmd {
2643 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
2644}
2645impl Default for MavCmd {
2646 fn default() -> Self {
2647 Self::DEFAULT
2648 }
2649}
2650#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2652#[cfg_attr(feature = "serde", serde(tag = "type"))]
2653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2654#[repr(u32)]
2655pub enum MavCmdDoAuxFunctionSwitchLevel {
2656 #[doc = "Switch Low."]
2657 MAV_CMD_DO_AUX_FUNCTION_SWITCH_LEVEL_LOW = 0,
2658 #[doc = "Switch Middle."]
2659 MAV_CMD_DO_AUX_FUNCTION_SWITCH_LEVEL_MIDDLE = 1,
2660 #[doc = "Switch High."]
2661 MAV_CMD_DO_AUX_FUNCTION_SWITCH_LEVEL_HIGH = 2,
2662}
2663impl MavCmdDoAuxFunctionSwitchLevel {
2664 pub const DEFAULT: Self = Self::MAV_CMD_DO_AUX_FUNCTION_SWITCH_LEVEL_LOW;
2665}
2666impl Default for MavCmdDoAuxFunctionSwitchLevel {
2667 fn default() -> Self {
2668 Self::DEFAULT
2669 }
2670}
2671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2673#[cfg_attr(feature = "serde", serde(tag = "type"))]
2674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2675#[repr(u32)]
2676#[doc = "Possible actions an aircraft can take to avoid a collision."]
2677pub enum MavCollisionAction {
2678 #[doc = "Ignore any potential collisions"]
2679 MAV_COLLISION_ACTION_NONE = 0,
2680 #[doc = "Report potential collision"]
2681 MAV_COLLISION_ACTION_REPORT = 1,
2682 #[doc = "Ascend or Descend to avoid threat"]
2683 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
2684 #[doc = "Move horizontally to avoid threat"]
2685 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
2686 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
2687 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
2688 #[doc = "Aircraft to fly directly back to its launch point"]
2689 MAV_COLLISION_ACTION_RTL = 5,
2690 #[doc = "Aircraft to stop in place"]
2691 MAV_COLLISION_ACTION_HOVER = 6,
2692}
2693impl MavCollisionAction {
2694 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
2695}
2696impl Default for MavCollisionAction {
2697 fn default() -> Self {
2698 Self::DEFAULT
2699 }
2700}
2701#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2703#[cfg_attr(feature = "serde", serde(tag = "type"))]
2704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2705#[repr(u32)]
2706#[doc = "Source of information about this collision."]
2707pub enum MavCollisionSrc {
2708 #[doc = "ID field references ADSB_VEHICLE packets"]
2709 MAV_COLLISION_SRC_ADSB = 0,
2710 #[doc = "ID field references MAVLink SRC ID"]
2711 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
2712}
2713impl MavCollisionSrc {
2714 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
2715}
2716impl Default for MavCollisionSrc {
2717 fn default() -> Self {
2718 Self::DEFAULT
2719 }
2720}
2721#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2723#[cfg_attr(feature = "serde", serde(tag = "type"))]
2724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2725#[repr(u32)]
2726#[doc = "Aircraft-rated danger from this threat."]
2727pub enum MavCollisionThreatLevel {
2728 #[doc = "Not a threat"]
2729 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
2730 #[doc = "Craft is mildly concerned about this threat"]
2731 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
2732 #[doc = "Craft is panicking, and may take actions to avoid threat"]
2733 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
2734}
2735impl MavCollisionThreatLevel {
2736 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
2737}
2738impl Default for MavCollisionThreatLevel {
2739 fn default() -> Self {
2740 Self::DEFAULT
2741 }
2742}
2743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2745#[cfg_attr(feature = "serde", serde(tag = "type"))]
2746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2747#[repr(u32)]
2748#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
2749pub enum MavComponent {
2750 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
2751 MAV_COMP_ID_ALL = 0,
2752 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
2753 MAV_COMP_ID_AUTOPILOT1 = 1,
2754 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2755 MAV_COMP_ID_USER1 = 25,
2756 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2757 MAV_COMP_ID_USER2 = 26,
2758 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2759 MAV_COMP_ID_USER3 = 27,
2760 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2761 MAV_COMP_ID_USER4 = 28,
2762 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2763 MAV_COMP_ID_USER5 = 29,
2764 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2765 MAV_COMP_ID_USER6 = 30,
2766 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2767 MAV_COMP_ID_USER7 = 31,
2768 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2769 MAV_COMP_ID_USER8 = 32,
2770 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2771 MAV_COMP_ID_USER9 = 33,
2772 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2773 MAV_COMP_ID_USER10 = 34,
2774 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2775 MAV_COMP_ID_USER11 = 35,
2776 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2777 MAV_COMP_ID_USER12 = 36,
2778 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2779 MAV_COMP_ID_USER13 = 37,
2780 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2781 MAV_COMP_ID_USER14 = 38,
2782 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2783 MAV_COMP_ID_USER15 = 39,
2784 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2785 MAV_COMP_ID_USER16 = 40,
2786 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2787 MAV_COMP_ID_USER17 = 41,
2788 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2789 MAV_COMP_ID_USER18 = 42,
2790 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2791 MAV_COMP_ID_USER19 = 43,
2792 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2793 MAV_COMP_ID_USER20 = 44,
2794 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2795 MAV_COMP_ID_USER21 = 45,
2796 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2797 MAV_COMP_ID_USER22 = 46,
2798 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2799 MAV_COMP_ID_USER23 = 47,
2800 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2801 MAV_COMP_ID_USER24 = 48,
2802 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2803 MAV_COMP_ID_USER25 = 49,
2804 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2805 MAV_COMP_ID_USER26 = 50,
2806 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2807 MAV_COMP_ID_USER27 = 51,
2808 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2809 MAV_COMP_ID_USER28 = 52,
2810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2811 MAV_COMP_ID_USER29 = 53,
2812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2813 MAV_COMP_ID_USER30 = 54,
2814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2815 MAV_COMP_ID_USER31 = 55,
2816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2817 MAV_COMP_ID_USER32 = 56,
2818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2819 MAV_COMP_ID_USER33 = 57,
2820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2821 MAV_COMP_ID_USER34 = 58,
2822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2823 MAV_COMP_ID_USER35 = 59,
2824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2825 MAV_COMP_ID_USER36 = 60,
2826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2827 MAV_COMP_ID_USER37 = 61,
2828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2829 MAV_COMP_ID_USER38 = 62,
2830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2831 MAV_COMP_ID_USER39 = 63,
2832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2833 MAV_COMP_ID_USER40 = 64,
2834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2835 MAV_COMP_ID_USER41 = 65,
2836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2837 MAV_COMP_ID_USER42 = 66,
2838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2839 MAV_COMP_ID_USER43 = 67,
2840 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
2841 MAV_COMP_ID_TELEMETRY_RADIO = 68,
2842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2843 MAV_COMP_ID_USER45 = 69,
2844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2845 MAV_COMP_ID_USER46 = 70,
2846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2847 MAV_COMP_ID_USER47 = 71,
2848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2849 MAV_COMP_ID_USER48 = 72,
2850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2851 MAV_COMP_ID_USER49 = 73,
2852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2853 MAV_COMP_ID_USER50 = 74,
2854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2855 MAV_COMP_ID_USER51 = 75,
2856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2857 MAV_COMP_ID_USER52 = 76,
2858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2859 MAV_COMP_ID_USER53 = 77,
2860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2861 MAV_COMP_ID_USER54 = 78,
2862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2863 MAV_COMP_ID_USER55 = 79,
2864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2865 MAV_COMP_ID_USER56 = 80,
2866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2867 MAV_COMP_ID_USER57 = 81,
2868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2869 MAV_COMP_ID_USER58 = 82,
2870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2871 MAV_COMP_ID_USER59 = 83,
2872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2873 MAV_COMP_ID_USER60 = 84,
2874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2875 MAV_COMP_ID_USER61 = 85,
2876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2877 MAV_COMP_ID_USER62 = 86,
2878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2879 MAV_COMP_ID_USER63 = 87,
2880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2881 MAV_COMP_ID_USER64 = 88,
2882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2883 MAV_COMP_ID_USER65 = 89,
2884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2885 MAV_COMP_ID_USER66 = 90,
2886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2887 MAV_COMP_ID_USER67 = 91,
2888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2889 MAV_COMP_ID_USER68 = 92,
2890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2891 MAV_COMP_ID_USER69 = 93,
2892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2893 MAV_COMP_ID_USER70 = 94,
2894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2895 MAV_COMP_ID_USER71 = 95,
2896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2897 MAV_COMP_ID_USER72 = 96,
2898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2899 MAV_COMP_ID_USER73 = 97,
2900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2901 MAV_COMP_ID_USER74 = 98,
2902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2903 MAV_COMP_ID_USER75 = 99,
2904 #[doc = "Camera #1."]
2905 MAV_COMP_ID_CAMERA = 100,
2906 #[doc = "Camera #2."]
2907 MAV_COMP_ID_CAMERA2 = 101,
2908 #[doc = "Camera #3."]
2909 MAV_COMP_ID_CAMERA3 = 102,
2910 #[doc = "Camera #4."]
2911 MAV_COMP_ID_CAMERA4 = 103,
2912 #[doc = "Camera #5."]
2913 MAV_COMP_ID_CAMERA5 = 104,
2914 #[doc = "Camera #6."]
2915 MAV_COMP_ID_CAMERA6 = 105,
2916 #[doc = "Servo #1."]
2917 MAV_COMP_ID_SERVO1 = 140,
2918 #[doc = "Servo #2."]
2919 MAV_COMP_ID_SERVO2 = 141,
2920 #[doc = "Servo #3."]
2921 MAV_COMP_ID_SERVO3 = 142,
2922 #[doc = "Servo #4."]
2923 MAV_COMP_ID_SERVO4 = 143,
2924 #[doc = "Servo #5."]
2925 MAV_COMP_ID_SERVO5 = 144,
2926 #[doc = "Servo #6."]
2927 MAV_COMP_ID_SERVO6 = 145,
2928 #[doc = "Servo #7."]
2929 MAV_COMP_ID_SERVO7 = 146,
2930 #[doc = "Servo #8."]
2931 MAV_COMP_ID_SERVO8 = 147,
2932 #[doc = "Servo #9."]
2933 MAV_COMP_ID_SERVO9 = 148,
2934 #[doc = "Servo #10."]
2935 MAV_COMP_ID_SERVO10 = 149,
2936 #[doc = "Servo #11."]
2937 MAV_COMP_ID_SERVO11 = 150,
2938 #[doc = "Servo #12."]
2939 MAV_COMP_ID_SERVO12 = 151,
2940 #[doc = "Servo #13."]
2941 MAV_COMP_ID_SERVO13 = 152,
2942 #[doc = "Servo #14."]
2943 MAV_COMP_ID_SERVO14 = 153,
2944 #[doc = "Gimbal #1."]
2945 MAV_COMP_ID_GIMBAL = 154,
2946 #[doc = "Logging component."]
2947 MAV_COMP_ID_LOG = 155,
2948 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2949 MAV_COMP_ID_ADSB = 156,
2950 #[doc = "On Screen Display (OSD) devices for video links."]
2951 MAV_COMP_ID_OSD = 157,
2952 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2953 MAV_COMP_ID_PERIPHERAL = 158,
2954 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2955 #[doc = "Gimbal ID for QX1."]
2956 MAV_COMP_ID_QX1_GIMBAL = 159,
2957 #[doc = "FLARM collision alert component."]
2958 MAV_COMP_ID_FLARM = 160,
2959 #[doc = "Parachute component."]
2960 MAV_COMP_ID_PARACHUTE = 161,
2961 #[doc = "Winch component."]
2962 MAV_COMP_ID_WINCH = 169,
2963 #[doc = "Gimbal #2."]
2964 MAV_COMP_ID_GIMBAL2 = 171,
2965 #[doc = "Gimbal #3."]
2966 MAV_COMP_ID_GIMBAL3 = 172,
2967 #[doc = "Gimbal #4"]
2968 MAV_COMP_ID_GIMBAL4 = 173,
2969 #[doc = "Gimbal #5."]
2970 MAV_COMP_ID_GIMBAL5 = 174,
2971 #[doc = "Gimbal #6."]
2972 MAV_COMP_ID_GIMBAL6 = 175,
2973 #[doc = "Battery #1."]
2974 MAV_COMP_ID_BATTERY = 180,
2975 #[doc = "Battery #2."]
2976 MAV_COMP_ID_BATTERY2 = 181,
2977 #[doc = "CAN over MAVLink client."]
2978 MAV_COMP_ID_MAVCAN = 189,
2979 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2980 MAV_COMP_ID_MISSIONPLANNER = 190,
2981 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2982 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2983 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2984 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2985 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2986 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2987 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2988 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2989 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2990 MAV_COMP_ID_PATHPLANNER = 195,
2991 #[doc = "Component that plans a collision free path between two points."]
2992 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2993 #[doc = "Component that provides position estimates using VIO techniques."]
2994 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2995 #[doc = "Component that manages pairing of vehicle and GCS."]
2996 MAV_COMP_ID_PAIRING_MANAGER = 198,
2997 #[doc = "Inertial Measurement Unit (IMU) #1."]
2998 MAV_COMP_ID_IMU = 200,
2999 #[doc = "Inertial Measurement Unit (IMU) #2."]
3000 MAV_COMP_ID_IMU_2 = 201,
3001 #[doc = "Inertial Measurement Unit (IMU) #3."]
3002 MAV_COMP_ID_IMU_3 = 202,
3003 #[doc = "GPS #1."]
3004 MAV_COMP_ID_GPS = 220,
3005 #[doc = "GPS #2."]
3006 MAV_COMP_ID_GPS2 = 221,
3007 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3008 MAV_COMP_ID_ODID_TXRX_1 = 236,
3009 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3010 MAV_COMP_ID_ODID_TXRX_2 = 237,
3011 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3012 MAV_COMP_ID_ODID_TXRX_3 = 238,
3013 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
3014 MAV_COMP_ID_UDP_BRIDGE = 240,
3015 #[doc = "Component to bridge to UART (i.e. from UDP)."]
3016 MAV_COMP_ID_UART_BRIDGE = 241,
3017 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
3018 MAV_COMP_ID_TUNNEL_NODE = 242,
3019 #[doc = "Illuminator"]
3020 MAV_COMP_ID_ILLUMINATOR = 243,
3021 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
3022 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
3023 MAV_COMP_ID_SYSTEM_CONTROL = 250,
3024}
3025impl MavComponent {
3026 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
3027}
3028impl Default for MavComponent {
3029 fn default() -> Self {
3030 Self::DEFAULT
3031 }
3032}
3033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3035#[cfg_attr(feature = "serde", serde(tag = "type"))]
3036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3037#[repr(u32)]
3038#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
3039#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
3040pub enum MavDataStream {
3041 #[doc = "Enable all data streams"]
3042 MAV_DATA_STREAM_ALL = 0,
3043 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
3044 MAV_DATA_STREAM_RAW_SENSORS = 1,
3045 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
3046 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
3047 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
3048 MAV_DATA_STREAM_RC_CHANNELS = 3,
3049 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
3050 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
3051 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
3052 MAV_DATA_STREAM_POSITION = 6,
3053 #[doc = "Dependent on the autopilot"]
3054 MAV_DATA_STREAM_EXTRA1 = 10,
3055 #[doc = "Dependent on the autopilot"]
3056 MAV_DATA_STREAM_EXTRA2 = 11,
3057 #[doc = "Dependent on the autopilot"]
3058 MAV_DATA_STREAM_EXTRA3 = 12,
3059}
3060impl MavDataStream {
3061 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
3062}
3063impl Default for MavDataStream {
3064 fn default() -> Self {
3065 Self::DEFAULT
3066 }
3067}
3068#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3070#[cfg_attr(feature = "serde", serde(tag = "type"))]
3071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3072#[repr(u32)]
3073#[doc = "Enumeration of distance sensor types"]
3074pub enum MavDistanceSensor {
3075 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
3076 MAV_DISTANCE_SENSOR_LASER = 0,
3077 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
3078 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
3079 #[doc = "Infrared rangefinder, e.g. Sharp units"]
3080 MAV_DISTANCE_SENSOR_INFRARED = 2,
3081 #[doc = "Radar type, e.g. uLanding units"]
3082 MAV_DISTANCE_SENSOR_RADAR = 3,
3083 #[doc = "Broken or unknown type, e.g. analog units"]
3084 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
3085}
3086impl MavDistanceSensor {
3087 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
3088}
3089impl Default for MavDistanceSensor {
3090 fn default() -> Self {
3091 Self::DEFAULT
3092 }
3093}
3094#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3096#[cfg_attr(feature = "serde", serde(tag = "type"))]
3097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3098#[repr(u32)]
3099#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
3100pub enum MavDoRepositionFlags {
3101 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
3102 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
3103}
3104impl MavDoRepositionFlags {
3105 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
3106}
3107impl Default for MavDoRepositionFlags {
3108 fn default() -> Self {
3109 Self::DEFAULT
3110 }
3111}
3112#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3114#[cfg_attr(feature = "serde", serde(tag = "type"))]
3115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3116#[repr(u32)]
3117#[doc = "Enumeration of estimator types"]
3118pub enum MavEstimatorType {
3119 #[doc = "Unknown type of the estimator."]
3120 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
3121 #[doc = "This is a naive estimator without any real covariance feedback."]
3122 MAV_ESTIMATOR_TYPE_NAIVE = 1,
3123 #[doc = "Computer vision based estimate. Might be up to scale."]
3124 MAV_ESTIMATOR_TYPE_VISION = 2,
3125 #[doc = "Visual-inertial estimate."]
3126 MAV_ESTIMATOR_TYPE_VIO = 3,
3127 #[doc = "Plain GPS estimate."]
3128 MAV_ESTIMATOR_TYPE_GPS = 4,
3129 #[doc = "Estimator integrating GPS and inertial sensing."]
3130 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
3131 #[doc = "Estimate from external motion capturing system."]
3132 MAV_ESTIMATOR_TYPE_MOCAP = 6,
3133 #[doc = "Estimator based on lidar sensor input."]
3134 MAV_ESTIMATOR_TYPE_LIDAR = 7,
3135 #[doc = "Estimator on autopilot."]
3136 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
3137}
3138impl MavEstimatorType {
3139 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
3140}
3141impl Default for MavEstimatorType {
3142 fn default() -> Self {
3143 Self::DEFAULT
3144 }
3145}
3146#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3148#[cfg_attr(feature = "serde", serde(tag = "type"))]
3149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3150#[repr(u32)]
3151#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
3152pub enum MavEventCurrentSequenceFlags {
3153 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
3154 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
3155}
3156impl MavEventCurrentSequenceFlags {
3157 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
3158}
3159impl Default for MavEventCurrentSequenceFlags {
3160 fn default() -> Self {
3161 Self::DEFAULT
3162 }
3163}
3164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3166#[cfg_attr(feature = "serde", serde(tag = "type"))]
3167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3168#[repr(u32)]
3169#[doc = "Reason for an event error response."]
3170pub enum MavEventErrorReason {
3171 #[doc = "The requested event is not available (anymore)."]
3172 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
3173}
3174impl MavEventErrorReason {
3175 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
3176}
3177impl Default for MavEventErrorReason {
3178 fn default() -> Self {
3179 Self::DEFAULT
3180 }
3181}
3182#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3184#[cfg_attr(feature = "serde", serde(tag = "type"))]
3185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3186#[repr(u32)]
3187#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
3188pub enum MavFrame {
3189 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
3190 MAV_FRAME_GLOBAL = 0,
3191 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
3192 MAV_FRAME_LOCAL_NED = 1,
3193 #[doc = "NOT a coordinate frame, indicates a mission command."]
3194 MAV_FRAME_MISSION = 2,
3195 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
3196 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
3197 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
3198 MAV_FRAME_LOCAL_ENU = 4,
3199 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
3200 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
3201 MAV_FRAME_GLOBAL_INT = 5,
3202 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
3203 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
3204 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
3205 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
3206 MAV_FRAME_LOCAL_OFFSET_NED = 7,
3207 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
3208 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
3209 MAV_FRAME_BODY_NED = 8,
3210 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
3211 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
3212 MAV_FRAME_BODY_OFFSET_NED = 9,
3213 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
3214 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
3215 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
3216 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
3217 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
3218 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
3219 MAV_FRAME_BODY_FRD = 12,
3220 #[deprecated = " (Deprecated since 2019-04)"]
3221 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
3222 MAV_FRAME_RESERVED_13 = 13,
3223 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
3224 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
3225 MAV_FRAME_RESERVED_14 = 14,
3226 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
3227 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
3228 MAV_FRAME_RESERVED_15 = 15,
3229 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
3230 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
3231 MAV_FRAME_RESERVED_16 = 16,
3232 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
3233 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
3234 MAV_FRAME_RESERVED_17 = 17,
3235 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
3236 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
3237 MAV_FRAME_RESERVED_18 = 18,
3238 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
3239 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
3240 MAV_FRAME_RESERVED_19 = 19,
3241 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
3242 MAV_FRAME_LOCAL_FRD = 20,
3243 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
3244 MAV_FRAME_LOCAL_FLU = 21,
3245}
3246impl MavFrame {
3247 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
3248}
3249impl Default for MavFrame {
3250 fn default() -> Self {
3251 Self::DEFAULT
3252 }
3253}
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
3260pub enum MavFtpErr {
3261 #[doc = "None: No error"]
3262 MAV_FTP_ERR_NONE = 0,
3263 #[doc = "Fail: Unknown failure"]
3264 MAV_FTP_ERR_FAIL = 1,
3265 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
3266 MAV_FTP_ERR_FAILERRNO = 2,
3267 #[doc = "InvalidDataSize: Payload size is invalid"]
3268 MAV_FTP_ERR_INVALIDDATASIZE = 3,
3269 #[doc = "InvalidSession: Session is not currently open"]
3270 MAV_FTP_ERR_INVALIDSESSION = 4,
3271 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
3272 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
3273 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
3274 MAV_FTP_ERR_EOF = 6,
3275 #[doc = "UnknownCommand: Unknown command / opcode"]
3276 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
3277 #[doc = "FileExists: File/directory already exists"]
3278 MAV_FTP_ERR_FILEEXISTS = 8,
3279 #[doc = "FileProtected: File/directory is write protected"]
3280 MAV_FTP_ERR_FILEPROTECTED = 9,
3281 #[doc = "FileNotFound: File/directory not found"]
3282 MAV_FTP_ERR_FILENOTFOUND = 10,
3283}
3284impl MavFtpErr {
3285 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
3286}
3287impl Default for MavFtpErr {
3288 fn default() -> Self {
3289 Self::DEFAULT
3290 }
3291}
3292#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3294#[cfg_attr(feature = "serde", serde(tag = "type"))]
3295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3296#[repr(u32)]
3297#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
3298pub enum MavFtpOpcode {
3299 #[doc = "None. Ignored, always ACKed"]
3300 MAV_FTP_OPCODE_NONE = 0,
3301 #[doc = "TerminateSession: Terminates open Read session"]
3302 MAV_FTP_OPCODE_TERMINATESESSION = 1,
3303 #[doc = "ResetSessions: Terminates all open read sessions"]
3304 MAV_FTP_OPCODE_RESETSESSION = 2,
3305 #[doc = "ListDirectory. List files and directories in path from offset"]
3306 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
3307 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
3308 MAV_FTP_OPCODE_OPENFILERO = 4,
3309 #[doc = "ReadFile: Reads size bytes from offset in session"]
3310 MAV_FTP_OPCODE_READFILE = 5,
3311 #[doc = "CreateFile: Creates file at path for writing, returns session"]
3312 MAV_FTP_OPCODE_CREATEFILE = 6,
3313 #[doc = "WriteFile: Writes size bytes to offset in session"]
3314 MAV_FTP_OPCODE_WRITEFILE = 7,
3315 #[doc = "RemoveFile: Remove file at path"]
3316 MAV_FTP_OPCODE_REMOVEFILE = 8,
3317 #[doc = "CreateDirectory: Creates directory at path"]
3318 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
3319 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
3320 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
3321 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
3322 MAV_FTP_OPCODE_OPENFILEWO = 11,
3323 #[doc = "TruncateFile: Truncate file at path to offset length"]
3324 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
3325 #[doc = "Rename: Rename path1 to path2"]
3326 MAV_FTP_OPCODE_RENAME = 13,
3327 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
3328 MAV_FTP_OPCODE_CALCFILECRC = 14,
3329 #[doc = "BurstReadFile: Burst download session file"]
3330 MAV_FTP_OPCODE_BURSTREADFILE = 15,
3331 #[doc = "ACK: ACK response"]
3332 MAV_FTP_OPCODE_ACK = 128,
3333 #[doc = "NAK: NAK response"]
3334 MAV_FTP_OPCODE_NAK = 129,
3335}
3336impl MavFtpOpcode {
3337 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
3338}
3339impl Default for MavFtpOpcode {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3346#[cfg_attr(feature = "serde", serde(tag = "type"))]
3347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3348#[repr(u32)]
3349#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
3350pub enum MavFuelType {
3351 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
3352 MAV_FUEL_TYPE_UNKNOWN = 0,
3353 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
3354 MAV_FUEL_TYPE_LIQUID = 1,
3355 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
3356 MAV_FUEL_TYPE_GAS = 2,
3357}
3358impl MavFuelType {
3359 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
3360}
3361impl Default for MavFuelType {
3362 fn default() -> Self {
3363 Self::DEFAULT
3364 }
3365}
3366bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
3367impl MavGeneratorStatusFlag {
3368 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
3369}
3370impl Default for MavGeneratorStatusFlag {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
3381pub enum MavGoto {
3382 #[doc = "Hold at the current position."]
3383 MAV_GOTO_DO_HOLD = 0,
3384 #[doc = "Continue with the next item in mission execution."]
3385 MAV_GOTO_DO_CONTINUE = 1,
3386 #[doc = "Hold at the current position of the system"]
3387 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
3388 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
3389 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
3390}
3391impl MavGoto {
3392 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
3393}
3394impl Default for MavGoto {
3395 fn default() -> Self {
3396 Self::DEFAULT
3397 }
3398}
3399#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3401#[cfg_attr(feature = "serde", serde(tag = "type"))]
3402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3403#[repr(u32)]
3404#[doc = "Enumeration of landed detector states"]
3405pub enum MavLandedState {
3406 #[doc = "MAV landed state is unknown"]
3407 MAV_LANDED_STATE_UNDEFINED = 0,
3408 #[doc = "MAV is landed (on ground)"]
3409 MAV_LANDED_STATE_ON_GROUND = 1,
3410 #[doc = "MAV is in air"]
3411 MAV_LANDED_STATE_IN_AIR = 2,
3412 #[doc = "MAV currently taking off"]
3413 MAV_LANDED_STATE_TAKEOFF = 3,
3414 #[doc = "MAV currently landing"]
3415 MAV_LANDED_STATE_LANDING = 4,
3416}
3417impl MavLandedState {
3418 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
3419}
3420impl Default for MavLandedState {
3421 fn default() -> Self {
3422 Self::DEFAULT
3423 }
3424}
3425#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3427#[cfg_attr(feature = "serde", serde(tag = "type"))]
3428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3429#[repr(u32)]
3430#[doc = "Result of mission operation (in a MISSION_ACK message)."]
3431pub enum MavMissionResult {
3432 #[doc = "mission accepted OK"]
3433 MAV_MISSION_ACCEPTED = 0,
3434 #[doc = "Generic error / not accepting mission commands at all right now."]
3435 MAV_MISSION_ERROR = 1,
3436 #[doc = "Coordinate frame is not supported."]
3437 MAV_MISSION_UNSUPPORTED_FRAME = 2,
3438 #[doc = "Command is not supported."]
3439 MAV_MISSION_UNSUPPORTED = 3,
3440 #[doc = "Mission items exceed storage space."]
3441 MAV_MISSION_NO_SPACE = 4,
3442 #[doc = "One of the parameters has an invalid value."]
3443 MAV_MISSION_INVALID = 5,
3444 #[doc = "param1 has an invalid value."]
3445 MAV_MISSION_INVALID_PARAM1 = 6,
3446 #[doc = "param2 has an invalid value."]
3447 MAV_MISSION_INVALID_PARAM2 = 7,
3448 #[doc = "param3 has an invalid value."]
3449 MAV_MISSION_INVALID_PARAM3 = 8,
3450 #[doc = "param4 has an invalid value."]
3451 MAV_MISSION_INVALID_PARAM4 = 9,
3452 #[doc = "x / param5 has an invalid value."]
3453 MAV_MISSION_INVALID_PARAM5_X = 10,
3454 #[doc = "y / param6 has an invalid value."]
3455 MAV_MISSION_INVALID_PARAM6_Y = 11,
3456 #[doc = "z / param7 has an invalid value."]
3457 MAV_MISSION_INVALID_PARAM7 = 12,
3458 #[doc = "Mission item received out of sequence"]
3459 MAV_MISSION_INVALID_SEQUENCE = 13,
3460 #[doc = "Not accepting any mission commands from this communication partner."]
3461 MAV_MISSION_DENIED = 14,
3462 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
3463 MAV_MISSION_OPERATION_CANCELLED = 15,
3464}
3465impl MavMissionResult {
3466 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
3467}
3468impl Default for MavMissionResult {
3469 fn default() -> Self {
3470 Self::DEFAULT
3471 }
3472}
3473#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3475#[cfg_attr(feature = "serde", serde(tag = "type"))]
3476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3477#[repr(u32)]
3478#[doc = "Type of mission items being requested/sent in mission protocol."]
3479pub enum MavMissionType {
3480 #[doc = "Items are mission commands for main mission."]
3481 MAV_MISSION_TYPE_MISSION = 0,
3482 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
3483 MAV_MISSION_TYPE_FENCE = 1,
3484 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
3485 MAV_MISSION_TYPE_RALLY = 2,
3486 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
3487 MAV_MISSION_TYPE_ALL = 255,
3488}
3489impl MavMissionType {
3490 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
3491}
3492impl Default for MavMissionType {
3493 fn default() -> Self {
3494 Self::DEFAULT
3495 }
3496}
3497#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3499#[cfg_attr(feature = "serde", serde(tag = "type"))]
3500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3501#[repr(u32)]
3502#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
3503pub enum MavMode {
3504 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
3505 MAV_MODE_PREFLIGHT = 0,
3506 #[doc = "System is allowed to be active, under assisted RC control."]
3507 MAV_MODE_STABILIZE_DISARMED = 80,
3508 #[doc = "System is allowed to be active, under assisted RC control."]
3509 MAV_MODE_STABILIZE_ARMED = 208,
3510 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
3511 MAV_MODE_MANUAL_DISARMED = 64,
3512 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
3513 MAV_MODE_MANUAL_ARMED = 192,
3514 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
3515 MAV_MODE_GUIDED_DISARMED = 88,
3516 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
3517 MAV_MODE_GUIDED_ARMED = 216,
3518 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
3519 MAV_MODE_AUTO_DISARMED = 92,
3520 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
3521 MAV_MODE_AUTO_ARMED = 220,
3522 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
3523 MAV_MODE_TEST_DISARMED = 66,
3524 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
3525 MAV_MODE_TEST_ARMED = 194,
3526}
3527impl MavMode {
3528 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
3529}
3530impl Default for MavMode {
3531 fn default() -> Self {
3532 Self::DEFAULT
3533 }
3534}
3535bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
3536impl MavModeFlag {
3537 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
3538}
3539impl Default for MavModeFlag {
3540 fn default() -> Self {
3541 Self::DEFAULT
3542 }
3543}
3544#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3546#[cfg_attr(feature = "serde", serde(tag = "type"))]
3547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3548#[repr(u32)]
3549#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
3550pub enum MavModeFlagDecodePosition {
3551 #[doc = "First bit: 10000000"]
3552 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
3553 #[doc = "Second bit: 01000000"]
3554 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
3555 #[doc = "Third bit: 00100000"]
3556 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
3557 #[doc = "Fourth bit: 00010000"]
3558 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
3559 #[doc = "Fifth bit: 00001000"]
3560 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
3561 #[doc = "Sixth bit: 00000100"]
3562 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
3563 #[doc = "Seventh bit: 00000010"]
3564 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
3565 #[doc = "Eighth bit: 00000001"]
3566 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
3567}
3568impl MavModeFlagDecodePosition {
3569 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
3570}
3571impl Default for MavModeFlagDecodePosition {
3572 fn default() -> Self {
3573 Self::DEFAULT
3574 }
3575}
3576#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3578#[cfg_attr(feature = "serde", serde(tag = "type"))]
3579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3580#[repr(u32)]
3581pub enum MavModeGimbal {
3582 #[doc = "Gimbal is powered on but has not started initializing yet."]
3583 MAV_MODE_GIMBAL_UNINITIALIZED = 0,
3584 #[doc = "Gimbal is currently running calibration on the pitch axis."]
3585 MAV_MODE_GIMBAL_CALIBRATING_PITCH = 1,
3586 #[doc = "Gimbal is currently running calibration on the roll axis."]
3587 MAV_MODE_GIMBAL_CALIBRATING_ROLL = 2,
3588 #[doc = "Gimbal is currently running calibration on the yaw axis."]
3589 MAV_MODE_GIMBAL_CALIBRATING_YAW = 3,
3590 #[doc = "Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter."]
3591 MAV_MODE_GIMBAL_INITIALIZED = 4,
3592 #[doc = "Gimbal is actively stabilizing."]
3593 MAV_MODE_GIMBAL_ACTIVE = 5,
3594 #[doc = "Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command."]
3595 MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT = 6,
3596}
3597impl MavModeGimbal {
3598 pub const DEFAULT: Self = Self::MAV_MODE_GIMBAL_UNINITIALIZED;
3599}
3600impl Default for MavModeGimbal {
3601 fn default() -> Self {
3602 Self::DEFAULT
3603 }
3604}
3605bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
3606impl MavModeProperty {
3607 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
3608}
3609impl Default for MavModeProperty {
3610 fn default() -> Self {
3611 Self::DEFAULT
3612 }
3613}
3614#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3616#[cfg_attr(feature = "serde", serde(tag = "type"))]
3617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3618#[repr(u32)]
3619#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
3620#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
3621pub enum MavMountMode {
3622 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
3623 MAV_MOUNT_MODE_RETRACT = 0,
3624 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
3625 MAV_MOUNT_MODE_NEUTRAL = 1,
3626 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
3627 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
3628 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
3629 MAV_MOUNT_MODE_RC_TARGETING = 3,
3630 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
3631 MAV_MOUNT_MODE_GPS_POINT = 4,
3632 #[doc = "Gimbal tracks system with specified system ID"]
3633 MAV_MOUNT_MODE_SYSID_TARGET = 5,
3634 #[doc = "Gimbal tracks home position"]
3635 MAV_MOUNT_MODE_HOME_LOCATION = 6,
3636}
3637impl MavMountMode {
3638 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
3639}
3640impl Default for MavMountMode {
3641 fn default() -> Self {
3642 Self::DEFAULT
3643 }
3644}
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650pub enum MavOdidArmStatus {
3651 #[doc = "Passing arming checks."]
3652 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
3653 #[doc = "Generic arming failure, see error string for details."]
3654 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
3655}
3656impl MavOdidArmStatus {
3657 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
3658}
3659impl Default for MavOdidArmStatus {
3660 fn default() -> Self {
3661 Self::DEFAULT
3662 }
3663}
3664#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3666#[cfg_attr(feature = "serde", serde(tag = "type"))]
3667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3668#[repr(u32)]
3669pub enum MavOdidAuthType {
3670 #[doc = "No authentication type is specified."]
3671 MAV_ODID_AUTH_TYPE_NONE = 0,
3672 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
3673 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
3674 #[doc = "Signature for the Operator ID."]
3675 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
3676 #[doc = "Signature for the entire message set."]
3677 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
3678 #[doc = "Authentication is provided by Network Remote ID."]
3679 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
3680 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
3681 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
3682}
3683impl MavOdidAuthType {
3684 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
3685}
3686impl Default for MavOdidAuthType {
3687 fn default() -> Self {
3688 Self::DEFAULT
3689 }
3690}
3691#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3693#[cfg_attr(feature = "serde", serde(tag = "type"))]
3694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3695#[repr(u32)]
3696pub enum MavOdidCategoryEu {
3697 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
3698 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
3699 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
3700 MAV_ODID_CATEGORY_EU_OPEN = 1,
3701 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
3702 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
3703 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
3704 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
3705}
3706impl MavOdidCategoryEu {
3707 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
3708}
3709impl Default for MavOdidCategoryEu {
3710 fn default() -> Self {
3711 Self::DEFAULT
3712 }
3713}
3714#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3716#[cfg_attr(feature = "serde", serde(tag = "type"))]
3717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3718#[repr(u32)]
3719pub enum MavOdidClassEu {
3720 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
3721 MAV_ODID_CLASS_EU_UNDECLARED = 0,
3722 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
3723 MAV_ODID_CLASS_EU_CLASS_0 = 1,
3724 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
3725 MAV_ODID_CLASS_EU_CLASS_1 = 2,
3726 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
3727 MAV_ODID_CLASS_EU_CLASS_2 = 3,
3728 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
3729 MAV_ODID_CLASS_EU_CLASS_3 = 4,
3730 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
3731 MAV_ODID_CLASS_EU_CLASS_4 = 5,
3732 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
3733 MAV_ODID_CLASS_EU_CLASS_5 = 6,
3734 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
3735 MAV_ODID_CLASS_EU_CLASS_6 = 7,
3736}
3737impl MavOdidClassEu {
3738 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
3739}
3740impl Default for MavOdidClassEu {
3741 fn default() -> Self {
3742 Self::DEFAULT
3743 }
3744}
3745#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3747#[cfg_attr(feature = "serde", serde(tag = "type"))]
3748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3749#[repr(u32)]
3750pub enum MavOdidClassificationType {
3751 #[doc = "The classification type for the UA is undeclared."]
3752 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
3753 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
3754 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
3755}
3756impl MavOdidClassificationType {
3757 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
3758}
3759impl Default for MavOdidClassificationType {
3760 fn default() -> Self {
3761 Self::DEFAULT
3762 }
3763}
3764#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3766#[cfg_attr(feature = "serde", serde(tag = "type"))]
3767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3768#[repr(u32)]
3769pub enum MavOdidDescType {
3770 #[doc = "Optional free-form text description of the purpose of the flight."]
3771 MAV_ODID_DESC_TYPE_TEXT = 0,
3772 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
3773 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
3774 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
3775 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
3776}
3777impl MavOdidDescType {
3778 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
3779}
3780impl Default for MavOdidDescType {
3781 fn default() -> Self {
3782 Self::DEFAULT
3783 }
3784}
3785#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3787#[cfg_attr(feature = "serde", serde(tag = "type"))]
3788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3789#[repr(u32)]
3790pub enum MavOdidHeightRef {
3791 #[doc = "The height field is relative to the take-off location."]
3792 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
3793 #[doc = "The height field is relative to ground."]
3794 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
3795}
3796impl MavOdidHeightRef {
3797 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
3798}
3799impl Default for MavOdidHeightRef {
3800 fn default() -> Self {
3801 Self::DEFAULT
3802 }
3803}
3804#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3806#[cfg_attr(feature = "serde", serde(tag = "type"))]
3807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3808#[repr(u32)]
3809pub enum MavOdidHorAcc {
3810 #[doc = "The horizontal accuracy is unknown."]
3811 MAV_ODID_HOR_ACC_UNKNOWN = 0,
3812 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
3813 MAV_ODID_HOR_ACC_10NM = 1,
3814 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
3815 MAV_ODID_HOR_ACC_4NM = 2,
3816 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
3817 MAV_ODID_HOR_ACC_2NM = 3,
3818 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
3819 MAV_ODID_HOR_ACC_1NM = 4,
3820 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
3821 MAV_ODID_HOR_ACC_0_5NM = 5,
3822 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
3823 MAV_ODID_HOR_ACC_0_3NM = 6,
3824 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
3825 MAV_ODID_HOR_ACC_0_1NM = 7,
3826 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
3827 MAV_ODID_HOR_ACC_0_05NM = 8,
3828 #[doc = "The horizontal accuracy is smaller than 30 meter."]
3829 MAV_ODID_HOR_ACC_30_METER = 9,
3830 #[doc = "The horizontal accuracy is smaller than 10 meter."]
3831 MAV_ODID_HOR_ACC_10_METER = 10,
3832 #[doc = "The horizontal accuracy is smaller than 3 meter."]
3833 MAV_ODID_HOR_ACC_3_METER = 11,
3834 #[doc = "The horizontal accuracy is smaller than 1 meter."]
3835 MAV_ODID_HOR_ACC_1_METER = 12,
3836}
3837impl MavOdidHorAcc {
3838 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
3839}
3840impl Default for MavOdidHorAcc {
3841 fn default() -> Self {
3842 Self::DEFAULT
3843 }
3844}
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850pub enum MavOdidIdType {
3851 #[doc = "No type defined."]
3852 MAV_ODID_ID_TYPE_NONE = 0,
3853 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
3854 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
3855 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
3856 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
3857 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
3858 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
3859 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
3860 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
3861}
3862impl MavOdidIdType {
3863 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
3864}
3865impl Default for MavOdidIdType {
3866 fn default() -> Self {
3867 Self::DEFAULT
3868 }
3869}
3870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3872#[cfg_attr(feature = "serde", serde(tag = "type"))]
3873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3874#[repr(u32)]
3875pub enum MavOdidOperatorIdType {
3876 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
3877 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
3878}
3879impl MavOdidOperatorIdType {
3880 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3881}
3882impl Default for MavOdidOperatorIdType {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892pub enum MavOdidOperatorLocationType {
3893 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3894 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3895 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3896 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3897 #[doc = "The location/altitude of the operator are fixed values."]
3898 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3899}
3900impl MavOdidOperatorLocationType {
3901 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3902}
3903impl Default for MavOdidOperatorLocationType {
3904 fn default() -> Self {
3905 Self::DEFAULT
3906 }
3907}
3908#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3910#[cfg_attr(feature = "serde", serde(tag = "type"))]
3911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3912#[repr(u32)]
3913pub enum MavOdidSpeedAcc {
3914 #[doc = "The speed accuracy is unknown."]
3915 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3916 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3917 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3918 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3919 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3920 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3921 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3922 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3923 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3924}
3925impl MavOdidSpeedAcc {
3926 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3927}
3928impl Default for MavOdidSpeedAcc {
3929 fn default() -> Self {
3930 Self::DEFAULT
3931 }
3932}
3933#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3935#[cfg_attr(feature = "serde", serde(tag = "type"))]
3936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3937#[repr(u32)]
3938pub enum MavOdidStatus {
3939 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3940 MAV_ODID_STATUS_UNDECLARED = 0,
3941 #[doc = "The UA is on the ground."]
3942 MAV_ODID_STATUS_GROUND = 1,
3943 #[doc = "The UA is in the air."]
3944 MAV_ODID_STATUS_AIRBORNE = 2,
3945 #[doc = "The UA is having an emergency."]
3946 MAV_ODID_STATUS_EMERGENCY = 3,
3947 #[doc = "The remote ID system is failing or unreliable in some way."]
3948 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3949}
3950impl MavOdidStatus {
3951 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3952}
3953impl Default for MavOdidStatus {
3954 fn default() -> Self {
3955 Self::DEFAULT
3956 }
3957}
3958#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3960#[cfg_attr(feature = "serde", serde(tag = "type"))]
3961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3962#[repr(u32)]
3963pub enum MavOdidTimeAcc {
3964 #[doc = "The timestamp accuracy is unknown."]
3965 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3966 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3967 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3968 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3969 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3970 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3971 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3972 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3973 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3974 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3975 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3976 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3977 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3978 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3979 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3980 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3981 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3982 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3983 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3984 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3985 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3986 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3987 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3988 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3989 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3990 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3991 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3992 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3993 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3994 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3995 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3996}
3997impl MavOdidTimeAcc {
3998 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3999}
4000impl Default for MavOdidTimeAcc {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4007#[cfg_attr(feature = "serde", serde(tag = "type"))]
4008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4009#[repr(u32)]
4010pub enum MavOdidUaType {
4011 #[doc = "No UA (Unmanned Aircraft) type defined."]
4012 MAV_ODID_UA_TYPE_NONE = 0,
4013 #[doc = "Aeroplane/Airplane. Fixed wing."]
4014 MAV_ODID_UA_TYPE_AEROPLANE = 1,
4015 #[doc = "Helicopter or multirotor."]
4016 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
4017 #[doc = "Gyroplane."]
4018 MAV_ODID_UA_TYPE_GYROPLANE = 3,
4019 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
4020 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
4021 #[doc = "Ornithopter."]
4022 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
4023 #[doc = "Glider."]
4024 MAV_ODID_UA_TYPE_GLIDER = 6,
4025 #[doc = "Kite."]
4026 MAV_ODID_UA_TYPE_KITE = 7,
4027 #[doc = "Free Balloon."]
4028 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
4029 #[doc = "Captive Balloon."]
4030 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
4031 #[doc = "Airship. E.g. a blimp."]
4032 MAV_ODID_UA_TYPE_AIRSHIP = 10,
4033 #[doc = "Free Fall/Parachute (unpowered)."]
4034 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
4035 #[doc = "Rocket."]
4036 MAV_ODID_UA_TYPE_ROCKET = 12,
4037 #[doc = "Tethered powered aircraft."]
4038 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
4039 #[doc = "Ground Obstacle."]
4040 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
4041 #[doc = "Other type of aircraft not listed earlier."]
4042 MAV_ODID_UA_TYPE_OTHER = 15,
4043}
4044impl MavOdidUaType {
4045 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
4046}
4047impl Default for MavOdidUaType {
4048 fn default() -> Self {
4049 Self::DEFAULT
4050 }
4051}
4052#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4054#[cfg_attr(feature = "serde", serde(tag = "type"))]
4055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4056#[repr(u32)]
4057pub enum MavOdidVerAcc {
4058 #[doc = "The vertical accuracy is unknown."]
4059 MAV_ODID_VER_ACC_UNKNOWN = 0,
4060 #[doc = "The vertical accuracy is smaller than 150 meter."]
4061 MAV_ODID_VER_ACC_150_METER = 1,
4062 #[doc = "The vertical accuracy is smaller than 45 meter."]
4063 MAV_ODID_VER_ACC_45_METER = 2,
4064 #[doc = "The vertical accuracy is smaller than 25 meter."]
4065 MAV_ODID_VER_ACC_25_METER = 3,
4066 #[doc = "The vertical accuracy is smaller than 10 meter."]
4067 MAV_ODID_VER_ACC_10_METER = 4,
4068 #[doc = "The vertical accuracy is smaller than 3 meter."]
4069 MAV_ODID_VER_ACC_3_METER = 5,
4070 #[doc = "The vertical accuracy is smaller than 1 meter."]
4071 MAV_ODID_VER_ACC_1_METER = 6,
4072}
4073impl MavOdidVerAcc {
4074 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
4075}
4076impl Default for MavOdidVerAcc {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4082#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4083#[cfg_attr(feature = "serde", serde(tag = "type"))]
4084#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4085#[repr(u32)]
4086#[doc = "Specifies the datatype of a MAVLink extended parameter."]
4087pub enum MavParamExtType {
4088 #[doc = "8-bit unsigned integer"]
4089 MAV_PARAM_EXT_TYPE_UINT8 = 1,
4090 #[doc = "8-bit signed integer"]
4091 MAV_PARAM_EXT_TYPE_INT8 = 2,
4092 #[doc = "16-bit unsigned integer"]
4093 MAV_PARAM_EXT_TYPE_UINT16 = 3,
4094 #[doc = "16-bit signed integer"]
4095 MAV_PARAM_EXT_TYPE_INT16 = 4,
4096 #[doc = "32-bit unsigned integer"]
4097 MAV_PARAM_EXT_TYPE_UINT32 = 5,
4098 #[doc = "32-bit signed integer"]
4099 MAV_PARAM_EXT_TYPE_INT32 = 6,
4100 #[doc = "64-bit unsigned integer"]
4101 MAV_PARAM_EXT_TYPE_UINT64 = 7,
4102 #[doc = "64-bit signed integer"]
4103 MAV_PARAM_EXT_TYPE_INT64 = 8,
4104 #[doc = "32-bit floating-point"]
4105 MAV_PARAM_EXT_TYPE_REAL32 = 9,
4106 #[doc = "64-bit floating-point"]
4107 MAV_PARAM_EXT_TYPE_REAL64 = 10,
4108 #[doc = "Custom Type"]
4109 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
4110}
4111impl MavParamExtType {
4112 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
4113}
4114impl Default for MavParamExtType {
4115 fn default() -> Self {
4116 Self::DEFAULT
4117 }
4118}
4119#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4121#[cfg_attr(feature = "serde", serde(tag = "type"))]
4122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4123#[repr(u32)]
4124#[doc = "Specifies the datatype of a MAVLink parameter."]
4125pub enum MavParamType {
4126 #[doc = "8-bit unsigned integer"]
4127 MAV_PARAM_TYPE_UINT8 = 1,
4128 #[doc = "8-bit signed integer"]
4129 MAV_PARAM_TYPE_INT8 = 2,
4130 #[doc = "16-bit unsigned integer"]
4131 MAV_PARAM_TYPE_UINT16 = 3,
4132 #[doc = "16-bit signed integer"]
4133 MAV_PARAM_TYPE_INT16 = 4,
4134 #[doc = "32-bit unsigned integer"]
4135 MAV_PARAM_TYPE_UINT32 = 5,
4136 #[doc = "32-bit signed integer"]
4137 MAV_PARAM_TYPE_INT32 = 6,
4138 #[doc = "64-bit unsigned integer"]
4139 MAV_PARAM_TYPE_UINT64 = 7,
4140 #[doc = "64-bit signed integer"]
4141 MAV_PARAM_TYPE_INT64 = 8,
4142 #[doc = "32-bit floating-point"]
4143 MAV_PARAM_TYPE_REAL32 = 9,
4144 #[doc = "64-bit floating-point"]
4145 MAV_PARAM_TYPE_REAL64 = 10,
4146}
4147impl MavParamType {
4148 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
4149}
4150impl Default for MavParamType {
4151 fn default() -> Self {
4152 Self::DEFAULT
4153 }
4154}
4155bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
4156impl MavPowerStatus {
4157 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
4158}
4159impl Default for MavPowerStatus {
4160 fn default() -> Self {
4161 Self::DEFAULT
4162 }
4163}
4164bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
4165impl MavProtocolCapability {
4166 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
4167}
4168impl Default for MavProtocolCapability {
4169 fn default() -> Self {
4170 Self::DEFAULT
4171 }
4172}
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Special ACK block numbers control activation of dataflash log streaming."]
4179pub enum MavRemoteLogDataBlockCommands {
4180 #[doc = "UAV to stop sending DataFlash blocks."]
4181 MAV_REMOTE_LOG_DATA_BLOCK_STOP = 2147483645,
4182 #[doc = "UAV to start sending DataFlash blocks."]
4183 MAV_REMOTE_LOG_DATA_BLOCK_START = 2147483646,
4184}
4185impl MavRemoteLogDataBlockCommands {
4186 pub const DEFAULT: Self = Self::MAV_REMOTE_LOG_DATA_BLOCK_STOP;
4187}
4188impl Default for MavRemoteLogDataBlockCommands {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4195#[cfg_attr(feature = "serde", serde(tag = "type"))]
4196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4197#[repr(u32)]
4198#[doc = "Possible remote log data block statuses."]
4199pub enum MavRemoteLogDataBlockStatuses {
4200 #[doc = "This block has NOT been received."]
4201 MAV_REMOTE_LOG_DATA_BLOCK_NACK = 0,
4202 #[doc = "This block has been received."]
4203 MAV_REMOTE_LOG_DATA_BLOCK_ACK = 1,
4204}
4205impl MavRemoteLogDataBlockStatuses {
4206 pub const DEFAULT: Self = Self::MAV_REMOTE_LOG_DATA_BLOCK_NACK;
4207}
4208impl Default for MavRemoteLogDataBlockStatuses {
4209 fn default() -> Self {
4210 Self::DEFAULT
4211 }
4212}
4213#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4215#[cfg_attr(feature = "serde", serde(tag = "type"))]
4216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4217#[repr(u32)]
4218#[doc = "Result from a MAVLink command (MAV_CMD)"]
4219pub enum MavResult {
4220 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
4221 MAV_RESULT_ACCEPTED = 0,
4222 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
4223 MAV_RESULT_TEMPORARILY_REJECTED = 1,
4224 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
4225 MAV_RESULT_DENIED = 2,
4226 #[doc = "Command is not supported (unknown)."]
4227 MAV_RESULT_UNSUPPORTED = 3,
4228 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
4229 MAV_RESULT_FAILED = 4,
4230 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
4231 MAV_RESULT_IN_PROGRESS = 5,
4232 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
4233 MAV_RESULT_CANCELLED = 6,
4234 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
4235 MAV_RESULT_COMMAND_LONG_ONLY = 7,
4236 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
4237 MAV_RESULT_COMMAND_INT_ONLY = 8,
4238 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
4239 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
4240}
4241impl MavResult {
4242 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
4243}
4244impl Default for MavResult {
4245 fn default() -> Self {
4246 Self::DEFAULT
4247 }
4248}
4249#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4251#[cfg_attr(feature = "serde", serde(tag = "type"))]
4252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4253#[repr(u32)]
4254#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
4255#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
4256pub enum MavRoi {
4257 #[doc = "No region of interest."]
4258 MAV_ROI_NONE = 0,
4259 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
4260 MAV_ROI_WPNEXT = 1,
4261 #[doc = "Point toward given waypoint."]
4262 MAV_ROI_WPINDEX = 2,
4263 #[doc = "Point toward fixed location."]
4264 MAV_ROI_LOCATION = 3,
4265 #[doc = "Point toward of given id."]
4266 MAV_ROI_TARGET = 4,
4267}
4268impl MavRoi {
4269 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
4270}
4271impl Default for MavRoi {
4272 fn default() -> Self {
4273 Self::DEFAULT
4274 }
4275}
4276#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4278#[cfg_attr(feature = "serde", serde(tag = "type"))]
4279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4280#[repr(u32)]
4281#[doc = "Enumeration of sensor orientation, according to its rotations"]
4282pub enum MavSensorOrientation {
4283 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
4284 MAV_SENSOR_ROTATION_NONE = 0,
4285 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
4286 MAV_SENSOR_ROTATION_YAW_45 = 1,
4287 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
4288 MAV_SENSOR_ROTATION_YAW_90 = 2,
4289 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
4290 MAV_SENSOR_ROTATION_YAW_135 = 3,
4291 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
4292 MAV_SENSOR_ROTATION_YAW_180 = 4,
4293 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
4294 MAV_SENSOR_ROTATION_YAW_225 = 5,
4295 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
4296 MAV_SENSOR_ROTATION_YAW_270 = 6,
4297 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
4298 MAV_SENSOR_ROTATION_YAW_315 = 7,
4299 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
4300 MAV_SENSOR_ROTATION_ROLL_180 = 8,
4301 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
4302 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
4303 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
4304 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
4305 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
4306 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
4307 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
4308 MAV_SENSOR_ROTATION_PITCH_180 = 12,
4309 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
4310 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
4311 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
4312 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
4313 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
4314 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
4315 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
4316 MAV_SENSOR_ROTATION_ROLL_90 = 16,
4317 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
4318 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
4319 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
4320 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
4321 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
4322 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
4323 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
4324 MAV_SENSOR_ROTATION_ROLL_270 = 20,
4325 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
4326 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
4327 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
4328 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
4329 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
4330 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
4331 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
4332 MAV_SENSOR_ROTATION_PITCH_90 = 24,
4333 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
4334 MAV_SENSOR_ROTATION_PITCH_270 = 25,
4335 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
4336 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
4337 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
4338 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
4339 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
4340 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
4341 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
4342 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
4343 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
4344 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
4345 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
4346 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
4347 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
4348 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
4349 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
4350 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
4351 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
4352 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
4353 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
4354 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
4355 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
4356 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
4357 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
4358 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
4359 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
4360 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
4361 #[doc = "Pitch: 315"]
4362 MAV_SENSOR_ROTATION_PITCH_315 = 39,
4363 #[doc = "Roll: 90, Pitch: 315"]
4364 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
4365 #[doc = "Custom orientation"]
4366 MAV_SENSOR_ROTATION_CUSTOM = 100,
4367}
4368impl MavSensorOrientation {
4369 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
4370}
4371impl Default for MavSensorOrientation {
4372 fn default() -> Self {
4373 Self::DEFAULT
4374 }
4375}
4376#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4378#[cfg_attr(feature = "serde", serde(tag = "type"))]
4379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4380#[repr(u32)]
4381#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
4382pub enum MavSeverity {
4383 #[doc = "System is unusable. This is a \"panic\" condition."]
4384 MAV_SEVERITY_EMERGENCY = 0,
4385 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
4386 MAV_SEVERITY_ALERT = 1,
4387 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
4388 MAV_SEVERITY_CRITICAL = 2,
4389 #[doc = "Indicates an error in secondary/redundant systems."]
4390 MAV_SEVERITY_ERROR = 3,
4391 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
4392 MAV_SEVERITY_WARNING = 4,
4393 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
4394 MAV_SEVERITY_NOTICE = 5,
4395 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
4396 MAV_SEVERITY_INFO = 6,
4397 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
4398 MAV_SEVERITY_DEBUG = 7,
4399}
4400impl MavSeverity {
4401 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
4402}
4403impl Default for MavSeverity {
4404 fn default() -> Self {
4405 Self::DEFAULT
4406 }
4407}
4408#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4410#[cfg_attr(feature = "serde", serde(tag = "type"))]
4411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4412#[repr(u32)]
4413#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
4414pub enum MavStandardMode {
4415 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
4416 MAV_STANDARD_MODE_NON_STANDARD = 0,
4417 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
4418 MAV_STANDARD_MODE_POSITION_HOLD = 1,
4419 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
4420 MAV_STANDARD_MODE_ORBIT = 2,
4421 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
4422 MAV_STANDARD_MODE_CRUISE = 3,
4423 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
4424 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
4425 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
4426 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
4427 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
4428 MAV_STANDARD_MODE_MISSION = 6,
4429 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
4430 MAV_STANDARD_MODE_LAND = 7,
4431 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
4432 MAV_STANDARD_MODE_TAKEOFF = 8,
4433}
4434impl MavStandardMode {
4435 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
4436}
4437impl Default for MavStandardMode {
4438 fn default() -> Self {
4439 Self::DEFAULT
4440 }
4441}
4442#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4444#[cfg_attr(feature = "serde", serde(tag = "type"))]
4445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4446#[repr(u32)]
4447pub enum MavState {
4448 #[doc = "Uninitialized system, state is unknown."]
4449 MAV_STATE_UNINIT = 0,
4450 #[doc = "System is booting up."]
4451 MAV_STATE_BOOT = 1,
4452 #[doc = "System is calibrating and not flight-ready."]
4453 MAV_STATE_CALIBRATING = 2,
4454 #[doc = "System is grounded and on standby. It can be launched any time."]
4455 MAV_STATE_STANDBY = 3,
4456 #[doc = "System is active and might be already airborne. Motors are engaged."]
4457 MAV_STATE_ACTIVE = 4,
4458 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
4459 MAV_STATE_CRITICAL = 5,
4460 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
4461 MAV_STATE_EMERGENCY = 6,
4462 #[doc = "System just initialized its power-down sequence, will shut down now."]
4463 MAV_STATE_POWEROFF = 7,
4464 #[doc = "System is terminating itself (failsafe or commanded)."]
4465 MAV_STATE_FLIGHT_TERMINATION = 8,
4466}
4467impl MavState {
4468 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
4469}
4470impl Default for MavState {
4471 fn default() -> Self {
4472 Self::DEFAULT
4473 }
4474}
4475bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
4476impl MavSysStatusSensor {
4477 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
4478}
4479impl Default for MavSysStatusSensor {
4480 fn default() -> Self {
4481 Self::DEFAULT
4482 }
4483}
4484bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
4485impl MavSysStatusSensorExtended {
4486 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
4487}
4488impl Default for MavSysStatusSensorExtended {
4489 fn default() -> Self {
4490 Self::DEFAULT
4491 }
4492}
4493#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4495#[cfg_attr(feature = "serde", serde(tag = "type"))]
4496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4497#[repr(u32)]
4498pub enum MavTunnelPayloadType {
4499 #[doc = "Encoding of payload unknown."]
4500 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
4501 #[doc = "Registered for STorM32 gimbal controller."]
4502 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
4503 #[doc = "Registered for STorM32 gimbal controller."]
4504 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
4505 #[doc = "Registered for STorM32 gimbal controller."]
4506 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
4507 #[doc = "Registered for STorM32 gimbal controller."]
4508 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
4509 #[doc = "Registered for STorM32 gimbal controller."]
4510 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
4511 #[doc = "Registered for STorM32 gimbal controller."]
4512 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
4513 #[doc = "Registered for STorM32 gimbal controller."]
4514 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
4515 #[doc = "Registered for STorM32 gimbal controller."]
4516 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
4517 #[doc = "Registered for STorM32 gimbal controller."]
4518 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
4519 #[doc = "Registered for STorM32 gimbal controller."]
4520 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
4521 #[doc = "Registered for ModalAI remote OSD protocol."]
4522 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
4523 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
4524 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
4525 #[doc = "Registered for ModalAI vendor use."]
4526 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
4527}
4528impl MavTunnelPayloadType {
4529 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
4530}
4531impl Default for MavTunnelPayloadType {
4532 fn default() -> Self {
4533 Self::DEFAULT
4534 }
4535}
4536#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4538#[cfg_attr(feature = "serde", serde(tag = "type"))]
4539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4540#[repr(u32)]
4541#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
4542pub enum MavType {
4543 #[doc = "Generic micro air vehicle"]
4544 MAV_TYPE_GENERIC = 0,
4545 #[doc = "Fixed wing aircraft."]
4546 MAV_TYPE_FIXED_WING = 1,
4547 #[doc = "Quadrotor"]
4548 MAV_TYPE_QUADROTOR = 2,
4549 #[doc = "Coaxial helicopter"]
4550 MAV_TYPE_COAXIAL = 3,
4551 #[doc = "Normal helicopter with tail rotor."]
4552 MAV_TYPE_HELICOPTER = 4,
4553 #[doc = "Ground installation"]
4554 MAV_TYPE_ANTENNA_TRACKER = 5,
4555 #[doc = "Operator control unit / ground control station"]
4556 MAV_TYPE_GCS = 6,
4557 #[doc = "Airship, controlled"]
4558 MAV_TYPE_AIRSHIP = 7,
4559 #[doc = "Free balloon, uncontrolled"]
4560 MAV_TYPE_FREE_BALLOON = 8,
4561 #[doc = "Rocket"]
4562 MAV_TYPE_ROCKET = 9,
4563 #[doc = "Ground rover"]
4564 MAV_TYPE_GROUND_ROVER = 10,
4565 #[doc = "Surface vessel, boat, ship"]
4566 MAV_TYPE_SURFACE_BOAT = 11,
4567 #[doc = "Submarine"]
4568 MAV_TYPE_SUBMARINE = 12,
4569 #[doc = "Hexarotor"]
4570 MAV_TYPE_HEXAROTOR = 13,
4571 #[doc = "Octorotor"]
4572 MAV_TYPE_OCTOROTOR = 14,
4573 #[doc = "Tricopter"]
4574 MAV_TYPE_TRICOPTER = 15,
4575 #[doc = "Flapping wing"]
4576 MAV_TYPE_FLAPPING_WING = 16,
4577 #[doc = "Kite"]
4578 MAV_TYPE_KITE = 17,
4579 #[doc = "Onboard companion controller"]
4580 MAV_TYPE_ONBOARD_CONTROLLER = 18,
4581 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
4582 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
4583 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
4584 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
4585 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
4586 MAV_TYPE_VTOL_TILTROTOR = 21,
4587 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
4588 MAV_TYPE_VTOL_FIXEDROTOR = 22,
4589 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
4590 MAV_TYPE_VTOL_TAILSITTER = 23,
4591 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
4592 MAV_TYPE_VTOL_TILTWING = 24,
4593 #[doc = "VTOL reserved 5"]
4594 MAV_TYPE_VTOL_RESERVED5 = 25,
4595 #[doc = "Gimbal"]
4596 MAV_TYPE_GIMBAL = 26,
4597 #[doc = "ADSB system"]
4598 MAV_TYPE_ADSB = 27,
4599 #[doc = "Steerable, nonrigid airfoil"]
4600 MAV_TYPE_PARAFOIL = 28,
4601 #[doc = "Dodecarotor"]
4602 MAV_TYPE_DODECAROTOR = 29,
4603 #[doc = "Camera"]
4604 MAV_TYPE_CAMERA = 30,
4605 #[doc = "Charging station"]
4606 MAV_TYPE_CHARGING_STATION = 31,
4607 #[doc = "FLARM collision avoidance system"]
4608 MAV_TYPE_FLARM = 32,
4609 #[doc = "Servo"]
4610 MAV_TYPE_SERVO = 33,
4611 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
4612 MAV_TYPE_ODID = 34,
4613 #[doc = "Decarotor"]
4614 MAV_TYPE_DECAROTOR = 35,
4615 #[doc = "Battery"]
4616 MAV_TYPE_BATTERY = 36,
4617 #[doc = "Parachute"]
4618 MAV_TYPE_PARACHUTE = 37,
4619 #[doc = "Log"]
4620 MAV_TYPE_LOG = 38,
4621 #[doc = "OSD"]
4622 MAV_TYPE_OSD = 39,
4623 #[doc = "IMU"]
4624 MAV_TYPE_IMU = 40,
4625 #[doc = "GPS"]
4626 MAV_TYPE_GPS = 41,
4627 #[doc = "Winch"]
4628 MAV_TYPE_WINCH = 42,
4629 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
4630 MAV_TYPE_GENERIC_MULTIROTOR = 43,
4631 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
4632 MAV_TYPE_ILLUMINATOR = 44,
4633 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
4634 MAV_TYPE_SPACECRAFT_ORBITER = 45,
4635}
4636impl MavType {
4637 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
4638}
4639impl Default for MavType {
4640 fn default() -> Self {
4641 Self::DEFAULT
4642 }
4643}
4644#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4646#[cfg_attr(feature = "serde", serde(tag = "type"))]
4647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4648#[repr(u32)]
4649#[doc = "Enumeration of VTOL states"]
4650pub enum MavVtolState {
4651 #[doc = "MAV is not configured as VTOL"]
4652 MAV_VTOL_STATE_UNDEFINED = 0,
4653 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
4654 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
4655 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
4656 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
4657 #[doc = "VTOL is in multicopter state"]
4658 MAV_VTOL_STATE_MC = 3,
4659 #[doc = "VTOL is in fixed-wing state"]
4660 MAV_VTOL_STATE_FW = 4,
4661}
4662impl MavVtolState {
4663 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
4664}
4665impl Default for MavVtolState {
4666 fn default() -> Self {
4667 Self::DEFAULT
4668 }
4669}
4670bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
4671impl MavWinchStatusFlag {
4672 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
4673}
4674impl Default for MavWinchStatusFlag {
4675 fn default() -> Self {
4676 Self::DEFAULT
4677 }
4678}
4679#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4681#[cfg_attr(feature = "serde", serde(tag = "type"))]
4682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4683#[repr(u32)]
4684pub enum MavlinkDataStreamType {
4685 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
4686 MAVLINK_DATA_STREAM_IMG_BMP = 1,
4687 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
4688 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
4689 MAVLINK_DATA_STREAM_IMG_PGM = 4,
4690 MAVLINK_DATA_STREAM_IMG_PNG = 5,
4691}
4692impl MavlinkDataStreamType {
4693 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
4694}
4695impl Default for MavlinkDataStreamType {
4696 fn default() -> Self {
4697 Self::DEFAULT
4698 }
4699}
4700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4702#[cfg_attr(feature = "serde", serde(tag = "type"))]
4703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4704#[repr(u32)]
4705#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
4706pub enum MissionState {
4707 #[doc = "The mission status reporting is not supported."]
4708 MISSION_STATE_UNKNOWN = 0,
4709 #[doc = "No mission on the vehicle."]
4710 MISSION_STATE_NO_MISSION = 1,
4711 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
4712 MISSION_STATE_NOT_STARTED = 2,
4713 #[doc = "Mission is active, and will execute mission items when in auto mode."]
4714 MISSION_STATE_ACTIVE = 3,
4715 #[doc = "Mission is paused when in auto mode."]
4716 MISSION_STATE_PAUSED = 4,
4717 #[doc = "Mission has executed all mission items."]
4718 MISSION_STATE_COMPLETE = 5,
4719}
4720impl MissionState {
4721 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
4722}
4723impl Default for MissionState {
4724 fn default() -> Self {
4725 Self::DEFAULT
4726 }
4727}
4728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4730#[cfg_attr(feature = "serde", serde(tag = "type"))]
4731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4732#[repr(u32)]
4733#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
4734pub enum MotorTestOrder {
4735 #[doc = "Default autopilot motor test method."]
4736 MOTOR_TEST_ORDER_DEFAULT = 0,
4737 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
4738 MOTOR_TEST_ORDER_SEQUENCE = 1,
4739 #[doc = "Motor numbers are specified as the output as labeled on the board."]
4740 MOTOR_TEST_ORDER_BOARD = 2,
4741}
4742impl MotorTestOrder {
4743 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
4744}
4745impl Default for MotorTestOrder {
4746 fn default() -> Self {
4747 Self::DEFAULT
4748 }
4749}
4750#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4752#[cfg_attr(feature = "serde", serde(tag = "type"))]
4753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4754#[repr(u32)]
4755#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
4756pub enum MotorTestThrottleType {
4757 #[doc = "Throttle as a percentage (0 ~ 100)"]
4758 MOTOR_TEST_THROTTLE_PERCENT = 0,
4759 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
4760 MOTOR_TEST_THROTTLE_PWM = 1,
4761 #[doc = "Throttle pass-through from pilot's transmitter."]
4762 MOTOR_TEST_THROTTLE_PILOT = 2,
4763 #[doc = "Per-motor compass calibration test."]
4764 MOTOR_TEST_COMPASS_CAL = 3,
4765}
4766impl MotorTestThrottleType {
4767 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
4768}
4769impl Default for MotorTestThrottleType {
4770 fn default() -> Self {
4771 Self::DEFAULT
4772 }
4773}
4774#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4776#[cfg_attr(feature = "serde", serde(tag = "type"))]
4777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4778#[repr(u32)]
4779pub enum NavVtolLandOptions {
4780 #[doc = "Default autopilot landing behaviour."]
4781 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
4782 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
4783 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
4784 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
4785 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
4786}
4787impl NavVtolLandOptions {
4788 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
4789}
4790impl Default for NavVtolLandOptions {
4791 fn default() -> Self {
4792 Self::DEFAULT
4793 }
4794}
4795#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4797#[cfg_attr(feature = "serde", serde(tag = "type"))]
4798#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4799#[repr(u32)]
4800#[doc = "Yaw behaviour during orbit flight."]
4801pub enum OrbitYawBehaviour {
4802 #[doc = "Vehicle front points to the center (default)."]
4803 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
4804 #[doc = "Vehicle front holds heading when message received."]
4805 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
4806 #[doc = "Yaw uncontrolled."]
4807 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
4808 #[doc = "Vehicle front follows flight path (tangential to circle)."]
4809 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
4810 #[doc = "Yaw controlled by RC input."]
4811 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
4812 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
4813 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
4814}
4815impl OrbitYawBehaviour {
4816 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
4817}
4818impl Default for OrbitYawBehaviour {
4819 fn default() -> Self {
4820 Self::DEFAULT
4821 }
4822}
4823#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4825#[cfg_attr(feature = "serde", serde(tag = "type"))]
4826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4827#[repr(u32)]
4828#[doc = "The error type for the OSD parameter editor."]
4829pub enum OsdParamConfigError {
4830 OSD_PARAM_SUCCESS = 0,
4831 OSD_PARAM_INVALID_SCREEN = 1,
4832 OSD_PARAM_INVALID_PARAMETER_INDEX = 2,
4833 OSD_PARAM_INVALID_PARAMETER = 3,
4834}
4835impl OsdParamConfigError {
4836 pub const DEFAULT: Self = Self::OSD_PARAM_SUCCESS;
4837}
4838impl Default for OsdParamConfigError {
4839 fn default() -> Self {
4840 Self::DEFAULT
4841 }
4842}
4843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4845#[cfg_attr(feature = "serde", serde(tag = "type"))]
4846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4847#[repr(u32)]
4848#[doc = "The type of parameter for the OSD parameter editor."]
4849pub enum OsdParamConfigType {
4850 OSD_PARAM_NONE = 0,
4851 OSD_PARAM_SERIAL_PROTOCOL = 1,
4852 OSD_PARAM_SERVO_FUNCTION = 2,
4853 OSD_PARAM_AUX_FUNCTION = 3,
4854 OSD_PARAM_FLIGHT_MODE = 4,
4855 OSD_PARAM_FAILSAFE_ACTION = 5,
4856 OSD_PARAM_FAILSAFE_ACTION_1 = 6,
4857 OSD_PARAM_FAILSAFE_ACTION_2 = 7,
4858 OSD_PARAM_NUM_TYPES = 8,
4859}
4860impl OsdParamConfigType {
4861 pub const DEFAULT: Self = Self::OSD_PARAM_NONE;
4862}
4863impl Default for OsdParamConfigType {
4864 fn default() -> Self {
4865 Self::DEFAULT
4866 }
4867}
4868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4870#[cfg_attr(feature = "serde", serde(tag = "type"))]
4871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4872#[repr(u32)]
4873#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
4874pub enum ParachuteAction {
4875 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
4876 PARACHUTE_DISABLE = 0,
4877 #[doc = "Enable auto-release of parachute."]
4878 PARACHUTE_ENABLE = 1,
4879 #[doc = "Release parachute and kill motors."]
4880 PARACHUTE_RELEASE = 2,
4881}
4882impl ParachuteAction {
4883 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
4884}
4885impl Default for ParachuteAction {
4886 fn default() -> Self {
4887 Self::DEFAULT
4888 }
4889}
4890#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4892#[cfg_attr(feature = "serde", serde(tag = "type"))]
4893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4894#[repr(u32)]
4895#[doc = "Result from PARAM_EXT_SET message."]
4896pub enum ParamAck {
4897 #[doc = "Parameter value ACCEPTED and SET"]
4898 PARAM_ACK_ACCEPTED = 0,
4899 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
4900 PARAM_ACK_VALUE_UNSUPPORTED = 1,
4901 #[doc = "Parameter failed to set"]
4902 PARAM_ACK_FAILED = 2,
4903 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
4904 PARAM_ACK_IN_PROGRESS = 3,
4905}
4906impl ParamAck {
4907 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
4908}
4909impl Default for ParamAck {
4910 fn default() -> Self {
4911 Self::DEFAULT
4912 }
4913}
4914#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4916#[cfg_attr(feature = "serde", serde(tag = "type"))]
4917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4918#[repr(u32)]
4919pub enum PidTuningAxis {
4920 PID_TUNING_ROLL = 1,
4921 PID_TUNING_PITCH = 2,
4922 PID_TUNING_YAW = 3,
4923 PID_TUNING_ACCZ = 4,
4924 PID_TUNING_STEER = 5,
4925 PID_TUNING_LANDING = 6,
4926}
4927impl PidTuningAxis {
4928 pub const DEFAULT: Self = Self::PID_TUNING_ROLL;
4929}
4930impl Default for PidTuningAxis {
4931 fn default() -> Self {
4932 Self::DEFAULT
4933 }
4934}
4935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4937#[cfg_attr(feature = "serde", serde(tag = "type"))]
4938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4939#[repr(u32)]
4940#[doc = "A mapping of plane flight modes for custom_mode field of heartbeat."]
4941pub enum PlaneMode {
4942 #[doc = "MANUAL"]
4943 PLANE_MODE_MANUAL = 0,
4944 #[doc = "CIRCLE"]
4945 PLANE_MODE_CIRCLE = 1,
4946 #[doc = "STABILIZE"]
4947 PLANE_MODE_STABILIZE = 2,
4948 #[doc = "TRAINING"]
4949 PLANE_MODE_TRAINING = 3,
4950 #[doc = "ACRO"]
4951 PLANE_MODE_ACRO = 4,
4952 #[doc = "FBWA"]
4953 PLANE_MODE_FLY_BY_WIRE_A = 5,
4954 #[doc = "FBWB"]
4955 PLANE_MODE_FLY_BY_WIRE_B = 6,
4956 #[doc = "CRUISE"]
4957 PLANE_MODE_CRUISE = 7,
4958 #[doc = "AUTOTUNE"]
4959 PLANE_MODE_AUTOTUNE = 8,
4960 #[doc = "AUTO"]
4961 PLANE_MODE_AUTO = 10,
4962 #[doc = "RTL"]
4963 PLANE_MODE_RTL = 11,
4964 #[doc = "LOITER"]
4965 PLANE_MODE_LOITER = 12,
4966 #[doc = "TAKEOFF"]
4967 PLANE_MODE_TAKEOFF = 13,
4968 #[doc = "AVOID ADSB"]
4969 PLANE_MODE_AVOID_ADSB = 14,
4970 #[doc = "GUIDED"]
4971 PLANE_MODE_GUIDED = 15,
4972 #[doc = "INITIALISING"]
4973 PLANE_MODE_INITIALIZING = 16,
4974 #[doc = "QSTABILIZE"]
4975 PLANE_MODE_QSTABILIZE = 17,
4976 #[doc = "QHOVER"]
4977 PLANE_MODE_QHOVER = 18,
4978 #[doc = "QLOITER"]
4979 PLANE_MODE_QLOITER = 19,
4980 #[doc = "QLAND"]
4981 PLANE_MODE_QLAND = 20,
4982 #[doc = "QRTL"]
4983 PLANE_MODE_QRTL = 21,
4984 #[doc = "QAUTOTUNE"]
4985 PLANE_MODE_QAUTOTUNE = 22,
4986 #[doc = "QACRO"]
4987 PLANE_MODE_QACRO = 23,
4988 #[doc = "THERMAL"]
4989 PLANE_MODE_THERMAL = 24,
4990 #[doc = "LOITER2QLAND"]
4991 PLANE_MODE_LOITER_ALT_QLAND = 25,
4992 #[doc = "AUTOLAND"]
4993 PLANE_MODE_AUTOLAND = 26,
4994}
4995impl PlaneMode {
4996 pub const DEFAULT: Self = Self::PLANE_MODE_MANUAL;
4997}
4998impl Default for PlaneMode {
4999 fn default() -> Self {
5000 Self::DEFAULT
5001 }
5002}
5003bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
5004impl PositionTargetTypemask {
5005 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
5006}
5007impl Default for PositionTargetTypemask {
5008 fn default() -> Self {
5009 Self::DEFAULT
5010 }
5011}
5012#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5014#[cfg_attr(feature = "serde", serde(tag = "type"))]
5015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5016#[repr(u32)]
5017#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
5018pub enum PrecisionLandMode {
5019 #[doc = "Normal (non-precision) landing."]
5020 PRECISION_LAND_MODE_DISABLED = 0,
5021 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
5022 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
5023 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
5024 PRECISION_LAND_MODE_REQUIRED = 2,
5025}
5026impl PrecisionLandMode {
5027 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
5028}
5029impl Default for PrecisionLandMode {
5030 fn default() -> Self {
5031 Self::DEFAULT
5032 }
5033}
5034#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5036#[cfg_attr(feature = "serde", serde(tag = "type"))]
5037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5038#[repr(u32)]
5039#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
5040pub enum PreflightStorageMissionAction {
5041 #[doc = "Read current mission data from persistent storage"]
5042 MISSION_READ_PERSISTENT = 0,
5043 #[doc = "Write current mission data to persistent storage"]
5044 MISSION_WRITE_PERSISTENT = 1,
5045 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
5046 MISSION_RESET_DEFAULT = 2,
5047}
5048impl PreflightStorageMissionAction {
5049 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
5050}
5051impl Default for PreflightStorageMissionAction {
5052 fn default() -> Self {
5053 Self::DEFAULT
5054 }
5055}
5056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5058#[cfg_attr(feature = "serde", serde(tag = "type"))]
5059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5060#[repr(u32)]
5061#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
5062pub enum PreflightStorageParameterAction {
5063 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
5064 PARAM_READ_PERSISTENT = 0,
5065 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
5066 PARAM_WRITE_PERSISTENT = 1,
5067 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
5068 PARAM_RESET_CONFIG_DEFAULT = 2,
5069 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
5070 PARAM_RESET_SENSOR_DEFAULT = 3,
5071 #[doc = "Reset all parameters, including operation counters, to default values"]
5072 PARAM_RESET_ALL_DEFAULT = 4,
5073}
5074impl PreflightStorageParameterAction {
5075 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
5076}
5077impl Default for PreflightStorageParameterAction {
5078 fn default() -> Self {
5079 Self::DEFAULT
5080 }
5081}
5082#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5084#[cfg_attr(feature = "serde", serde(tag = "type"))]
5085#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5086#[repr(u32)]
5087#[doc = "Flags in RALLY_POINT message."]
5088pub enum RallyFlags {
5089 #[doc = "Flag set when requiring favorable winds for landing."]
5090 FAVORABLE_WIND = 1,
5091 #[doc = "Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land."]
5092 LAND_IMMEDIATELY = 2,
5093 #[doc = "True if the following altitude frame value is valid."]
5094 ALT_FRAME_VALID = 4,
5095 #[doc = "2 bit value representing altitude frame. 0: absolute, 1: relative home, 2: relative origin, 3: relative terrain"]
5096 ALT_FRAME = 24,
5097}
5098impl RallyFlags {
5099 pub const DEFAULT: Self = Self::FAVORABLE_WIND;
5100}
5101impl Default for RallyFlags {
5102 fn default() -> Self {
5103 Self::DEFAULT
5104 }
5105}
5106#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5108#[cfg_attr(feature = "serde", serde(tag = "type"))]
5109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5110#[repr(u32)]
5111#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
5112pub enum RcSubType {
5113 #[doc = "Spektrum DSM2"]
5114 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
5115 #[doc = "Spektrum DSMX"]
5116 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
5117 #[doc = "Spektrum DSMX8"]
5118 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
5119}
5120impl RcSubType {
5121 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
5122}
5123impl Default for RcSubType {
5124 fn default() -> Self {
5125 Self::DEFAULT
5126 }
5127}
5128#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5130#[cfg_attr(feature = "serde", serde(tag = "type"))]
5131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5132#[repr(u32)]
5133#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
5134pub enum RcType {
5135 #[doc = "Spektrum"]
5136 RC_TYPE_SPEKTRUM = 0,
5137 #[doc = "CRSF"]
5138 RC_TYPE_CRSF = 1,
5139}
5140impl RcType {
5141 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
5142}
5143impl Default for RcType {
5144 fn default() -> Self {
5145 Self::DEFAULT
5146 }
5147}
5148#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5150#[cfg_attr(feature = "serde", serde(tag = "type"))]
5151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5152#[repr(u32)]
5153#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
5154pub enum RebootShutdownConditions {
5155 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
5156 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
5157 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
5158 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
5159}
5160impl RebootShutdownConditions {
5161 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
5162}
5163impl Default for RebootShutdownConditions {
5164 fn default() -> Self {
5165 Self::DEFAULT
5166 }
5167}
5168#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5170#[cfg_attr(feature = "serde", serde(tag = "type"))]
5171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5172#[repr(u32)]
5173#[doc = "A mapping of rover flight modes for custom_mode field of heartbeat."]
5174pub enum RoverMode {
5175 #[doc = "MANUAL"]
5176 ROVER_MODE_MANUAL = 0,
5177 #[doc = "ACRO"]
5178 ROVER_MODE_ACRO = 1,
5179 #[doc = "STEERING"]
5180 ROVER_MODE_STEERING = 3,
5181 #[doc = "HOLD"]
5182 ROVER_MODE_HOLD = 4,
5183 #[doc = "LOITER"]
5184 ROVER_MODE_LOITER = 5,
5185 #[doc = "FOLLOW"]
5186 ROVER_MODE_FOLLOW = 6,
5187 #[doc = "SIMPLE"]
5188 ROVER_MODE_SIMPLE = 7,
5189 #[doc = "DOCK"]
5190 ROVER_MODE_DOCK = 8,
5191 #[doc = "CIRCLE"]
5192 ROVER_MODE_CIRCLE = 9,
5193 #[doc = "AUTO"]
5194 ROVER_MODE_AUTO = 10,
5195 #[doc = "RTL"]
5196 ROVER_MODE_RTL = 11,
5197 #[doc = "SMART RTL"]
5198 ROVER_MODE_SMART_RTL = 12,
5199 #[doc = "GUIDED"]
5200 ROVER_MODE_GUIDED = 15,
5201 #[doc = "INITIALISING"]
5202 ROVER_MODE_INITIALIZING = 16,
5203}
5204impl RoverMode {
5205 pub const DEFAULT: Self = Self::ROVER_MODE_MANUAL;
5206}
5207impl Default for RoverMode {
5208 fn default() -> Self {
5209 Self::DEFAULT
5210 }
5211}
5212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5214#[cfg_attr(feature = "serde", serde(tag = "type"))]
5215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5216#[repr(u32)]
5217#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
5218pub enum RtkBaselineCoordinateSystem {
5219 #[doc = "Earth-centered, Earth-fixed"]
5220 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
5221 #[doc = "RTK basestation centered, north, east, down"]
5222 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
5223}
5224impl RtkBaselineCoordinateSystem {
5225 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
5226}
5227impl Default for RtkBaselineCoordinateSystem {
5228 fn default() -> Self {
5229 Self::DEFAULT
5230 }
5231}
5232#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5234#[cfg_attr(feature = "serde", serde(tag = "type"))]
5235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5236#[repr(u32)]
5237#[doc = "Possible safety switch states."]
5238pub enum SafetySwitchState {
5239 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
5240 SAFETY_SWITCH_STATE_SAFE = 0,
5241 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
5242 SAFETY_SWITCH_STATE_DANGEROUS = 1,
5243}
5244impl SafetySwitchState {
5245 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
5246}
5247impl Default for SafetySwitchState {
5248 fn default() -> Self {
5249 Self::DEFAULT
5250 }
5251}
5252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5254#[cfg_attr(feature = "serde", serde(tag = "type"))]
5255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5256#[repr(u32)]
5257pub enum ScriptingCmd {
5258 #[doc = "Start a REPL session."]
5259 SCRIPTING_CMD_REPL_START = 0,
5260 #[doc = "End a REPL session."]
5261 SCRIPTING_CMD_REPL_STOP = 1,
5262 #[doc = "Stop execution of scripts."]
5263 SCRIPTING_CMD_STOP = 2,
5264 #[doc = "Stop execution of scripts and restart."]
5265 SCRIPTING_CMD_STOP_AND_RESTART = 3,
5266}
5267impl ScriptingCmd {
5268 pub const DEFAULT: Self = Self::SCRIPTING_CMD_REPL_START;
5269}
5270impl Default for ScriptingCmd {
5271 fn default() -> Self {
5272 Self::DEFAULT
5273 }
5274}
5275#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5277#[cfg_attr(feature = "serde", serde(tag = "type"))]
5278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5279#[repr(u32)]
5280pub enum SecureCommandOp {
5281 #[doc = "Get an 8 byte session key which is used for remote secure updates which operate on flight controller data such as bootloader public keys. Return data will be 8 bytes on success. The session key remains valid until either the flight controller reboots or another SECURE_COMMAND_GET_SESSION_KEY is run."]
5282 SECURE_COMMAND_GET_SESSION_KEY = 0,
5283 #[doc = "Get an 8 byte session key which is used for remote secure updates which operate on RemoteID module data. Return data will be 8 bytes on success. The session key remains valid until either the remote ID module reboots or another SECURE_COMMAND_GET_REMOTEID_SESSION_KEY is run."]
5284 SECURE_COMMAND_GET_REMOTEID_SESSION_KEY = 1,
5285 #[doc = "Remove range of public keys from the bootloader. Command data consists of two bytes, first byte if index of first public key to remove. Second byte is the number of keys to remove. If all keys are removed then secure boot is disabled and insecure firmware can be loaded."]
5286 SECURE_COMMAND_REMOVE_PUBLIC_KEYS = 2,
5287 #[doc = "Get current public keys from the bootloader. Command data consists of two bytes, first byte is index of first public key to fetch, 2nd byte is number of keys to fetch. Total data needs to fit in data portion of reply (max 6 keys for 32 byte keys). Reply data has the index of the first key in the first byte, followed by the keys. Returned keys may be less than the number of keys requested if there are less keys installed than requested."]
5288 SECURE_COMMAND_GET_PUBLIC_KEYS = 3,
5289 #[doc = "Set current public keys in the bootloader. Data consists of a one byte public key index followed by the public keys. With 32 byte keys this allows for up to 6 keys to be set in one request. Keys outside of the range that is being set will remain unchanged."]
5290 SECURE_COMMAND_SET_PUBLIC_KEYS = 4,
5291 #[doc = "Get config data for remote ID module. This command should be sent to the component ID of the flight controller which will forward it to the RemoteID module either over mavlink or DroneCAN. Data format is specific to the RemoteID implementation, see RemoteID firmware documentation for details."]
5292 SECURE_COMMAND_GET_REMOTEID_CONFIG = 5,
5293 #[doc = "Set config data for remote ID module. This command should be sent to the component ID of the flight controller which will forward it to the RemoteID module either over mavlink or DroneCAN. Data format is specific to the RemoteID implementation, see RemoteID firmware documentation for details."]
5294 SECURE_COMMAND_SET_REMOTEID_CONFIG = 6,
5295 #[doc = "Flash bootloader from local storage. Data is the filename to use for the bootloader. This is intended to be used with MAVFtp to upload a new bootloader to a microSD before flashing."]
5296 SECURE_COMMAND_FLASH_BOOTLOADER = 7,
5297}
5298impl SecureCommandOp {
5299 pub const DEFAULT: Self = Self::SECURE_COMMAND_GET_SESSION_KEY;
5300}
5301impl Default for SecureCommandOp {
5302 fn default() -> Self {
5303 Self::DEFAULT
5304 }
5305}
5306#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5307#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5308#[cfg_attr(feature = "serde", serde(tag = "type"))]
5309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5310#[repr(u32)]
5311#[doc = "SERIAL_CONTROL device types"]
5312pub enum SerialControlDev {
5313 #[doc = "First telemetry port"]
5314 SERIAL_CONTROL_DEV_TELEM1 = 0,
5315 #[doc = "Second telemetry port"]
5316 SERIAL_CONTROL_DEV_TELEM2 = 1,
5317 #[doc = "First GPS port"]
5318 SERIAL_CONTROL_DEV_GPS1 = 2,
5319 #[doc = "Second GPS port"]
5320 SERIAL_CONTROL_DEV_GPS2 = 3,
5321 #[doc = "system shell"]
5322 SERIAL_CONTROL_DEV_SHELL = 10,
5323 #[doc = "SERIAL0"]
5324 SERIAL_CONTROL_SERIAL0 = 100,
5325 #[doc = "SERIAL1"]
5326 SERIAL_CONTROL_SERIAL1 = 101,
5327 #[doc = "SERIAL2"]
5328 SERIAL_CONTROL_SERIAL2 = 102,
5329 #[doc = "SERIAL3"]
5330 SERIAL_CONTROL_SERIAL3 = 103,
5331 #[doc = "SERIAL4"]
5332 SERIAL_CONTROL_SERIAL4 = 104,
5333 #[doc = "SERIAL5"]
5334 SERIAL_CONTROL_SERIAL5 = 105,
5335 #[doc = "SERIAL6"]
5336 SERIAL_CONTROL_SERIAL6 = 106,
5337 #[doc = "SERIAL7"]
5338 SERIAL_CONTROL_SERIAL7 = 107,
5339 #[doc = "SERIAL8"]
5340 SERIAL_CONTROL_SERIAL8 = 108,
5341 #[doc = "SERIAL9"]
5342 SERIAL_CONTROL_SERIAL9 = 109,
5343}
5344impl SerialControlDev {
5345 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
5346}
5347impl Default for SerialControlDev {
5348 fn default() -> Self {
5349 Self::DEFAULT
5350 }
5351}
5352bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
5353impl SerialControlFlag {
5354 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
5355}
5356impl Default for SerialControlFlag {
5357 fn default() -> Self {
5358 Self::DEFAULT
5359 }
5360}
5361#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5363#[cfg_attr(feature = "serde", serde(tag = "type"))]
5364#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5365#[repr(u32)]
5366#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
5367pub enum SetFocusType {
5368 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
5369 FOCUS_TYPE_STEP = 0,
5370 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
5371 FOCUS_TYPE_CONTINUOUS = 1,
5372 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
5373 FOCUS_TYPE_RANGE = 2,
5374 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
5375 FOCUS_TYPE_METERS = 3,
5376 #[doc = "Focus automatically."]
5377 FOCUS_TYPE_AUTO = 4,
5378 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
5379 FOCUS_TYPE_AUTO_SINGLE = 5,
5380 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
5381 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
5382}
5383impl SetFocusType {
5384 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
5385}
5386impl Default for SetFocusType {
5387 fn default() -> Self {
5388 Self::DEFAULT
5389 }
5390}
5391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5393#[cfg_attr(feature = "serde", serde(tag = "type"))]
5394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5395#[repr(u32)]
5396#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
5397pub enum SpeedType {
5398 #[doc = "Airspeed"]
5399 SPEED_TYPE_AIRSPEED = 0,
5400 #[doc = "Groundspeed"]
5401 SPEED_TYPE_GROUNDSPEED = 1,
5402 #[doc = "Climb speed"]
5403 SPEED_TYPE_CLIMB_SPEED = 2,
5404 #[doc = "Descent speed"]
5405 SPEED_TYPE_DESCENT_SPEED = 3,
5406}
5407impl SpeedType {
5408 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
5409}
5410impl Default for SpeedType {
5411 fn default() -> Self {
5412 Self::DEFAULT
5413 }
5414}
5415#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5417#[cfg_attr(feature = "serde", serde(tag = "type"))]
5418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5419#[repr(u32)]
5420#[doc = "Flags to indicate the status of camera storage."]
5421pub enum StorageStatus {
5422 #[doc = "Storage is missing (no microSD card loaded for example.)"]
5423 STORAGE_STATUS_EMPTY = 0,
5424 #[doc = "Storage present but unformatted."]
5425 STORAGE_STATUS_UNFORMATTED = 1,
5426 #[doc = "Storage present and ready."]
5427 STORAGE_STATUS_READY = 2,
5428 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
5429 STORAGE_STATUS_NOT_SUPPORTED = 3,
5430}
5431impl StorageStatus {
5432 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
5433}
5434impl Default for StorageStatus {
5435 fn default() -> Self {
5436 Self::DEFAULT
5437 }
5438}
5439#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5441#[cfg_attr(feature = "serde", serde(tag = "type"))]
5442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5443#[repr(u32)]
5444#[doc = "Flags to indicate the type of storage."]
5445pub enum StorageType {
5446 #[doc = "Storage type is not known."]
5447 STORAGE_TYPE_UNKNOWN = 0,
5448 #[doc = "Storage type is USB device."]
5449 STORAGE_TYPE_USB_STICK = 1,
5450 #[doc = "Storage type is SD card."]
5451 STORAGE_TYPE_SD = 2,
5452 #[doc = "Storage type is microSD card."]
5453 STORAGE_TYPE_MICROSD = 3,
5454 #[doc = "Storage type is CFast."]
5455 STORAGE_TYPE_CF = 4,
5456 #[doc = "Storage type is CFexpress."]
5457 STORAGE_TYPE_CFE = 5,
5458 #[doc = "Storage type is XQD."]
5459 STORAGE_TYPE_XQD = 6,
5460 #[doc = "Storage type is HD mass storage type."]
5461 STORAGE_TYPE_HD = 7,
5462 #[doc = "Storage type is other, not listed type."]
5463 STORAGE_TYPE_OTHER = 254,
5464}
5465impl StorageType {
5466 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
5467}
5468impl Default for StorageType {
5469 fn default() -> Self {
5470 Self::DEFAULT
5471 }
5472}
5473bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
5474impl StorageUsageFlag {
5475 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
5476}
5477impl Default for StorageUsageFlag {
5478 fn default() -> Self {
5479 Self::DEFAULT
5480 }
5481}
5482#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5484#[cfg_attr(feature = "serde", serde(tag = "type"))]
5485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5486#[repr(u32)]
5487#[doc = "A mapping of sub flight modes for custom_mode field of heartbeat."]
5488pub enum SubMode {
5489 #[doc = "STABILIZE"]
5490 SUB_MODE_STABILIZE = 0,
5491 #[doc = "ACRO"]
5492 SUB_MODE_ACRO = 1,
5493 #[doc = "ALT HOLD"]
5494 SUB_MODE_ALT_HOLD = 2,
5495 #[doc = "AUTO"]
5496 SUB_MODE_AUTO = 3,
5497 #[doc = "GUIDED"]
5498 SUB_MODE_GUIDED = 4,
5499 #[doc = "CIRCLE"]
5500 SUB_MODE_CIRCLE = 7,
5501 #[doc = "SURFACE"]
5502 SUB_MODE_SURFACE = 9,
5503 #[doc = "POSHOLD"]
5504 SUB_MODE_POSHOLD = 16,
5505 #[doc = "MANUAL"]
5506 SUB_MODE_MANUAL = 19,
5507 #[doc = "MOTORDETECT"]
5508 SUB_MODE_MOTORDETECT = 20,
5509 #[doc = "SURFTRAK"]
5510 SUB_MODE_SURFTRAK = 21,
5511}
5512impl SubMode {
5513 pub const DEFAULT: Self = Self::SUB_MODE_STABILIZE;
5514}
5515impl Default for SubMode {
5516 fn default() -> Self {
5517 Self::DEFAULT
5518 }
5519}
5520#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5522#[cfg_attr(feature = "serde", serde(tag = "type"))]
5523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5524#[repr(u32)]
5525#[doc = "A mapping of antenna tracker flight modes for custom_mode field of heartbeat."]
5526pub enum TrackerMode {
5527 #[doc = "MANUAL"]
5528 TRACKER_MODE_MANUAL = 0,
5529 #[doc = "STOP"]
5530 TRACKER_MODE_STOP = 1,
5531 #[doc = "SCAN"]
5532 TRACKER_MODE_SCAN = 2,
5533 #[doc = "SERVO TEST"]
5534 TRACKER_MODE_SERVO_TEST = 3,
5535 #[doc = "GUIDED"]
5536 TRACKER_MODE_GUIDED = 4,
5537 #[doc = "AUTO"]
5538 TRACKER_MODE_AUTO = 10,
5539 #[doc = "INITIALISING"]
5540 TRACKER_MODE_INITIALIZING = 16,
5541}
5542impl TrackerMode {
5543 pub const DEFAULT: Self = Self::TRACKER_MODE_MANUAL;
5544}
5545impl Default for TrackerMode {
5546 fn default() -> Self {
5547 Self::DEFAULT
5548 }
5549}
5550#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5552#[cfg_attr(feature = "serde", serde(tag = "type"))]
5553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5554#[repr(u32)]
5555#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
5556pub enum TuneFormat {
5557 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
5558 TUNE_FORMAT_QBASIC1_1 = 1,
5559 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
5560 TUNE_FORMAT_MML_MODERN = 2,
5561}
5562impl TuneFormat {
5563 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
5564}
5565impl Default for TuneFormat {
5566 fn default() -> Self {
5567 Self::DEFAULT
5568 }
5569}
5570#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5571#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5572#[cfg_attr(feature = "serde", serde(tag = "type"))]
5573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5574#[repr(u32)]
5575#[doc = "Generalized UAVCAN node health"]
5576pub enum UavcanNodeHealth {
5577 #[doc = "The node is functioning properly."]
5578 UAVCAN_NODE_HEALTH_OK = 0,
5579 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
5580 UAVCAN_NODE_HEALTH_WARNING = 1,
5581 #[doc = "The node has encountered a major failure."]
5582 UAVCAN_NODE_HEALTH_ERROR = 2,
5583 #[doc = "The node has suffered a fatal malfunction."]
5584 UAVCAN_NODE_HEALTH_CRITICAL = 3,
5585}
5586impl UavcanNodeHealth {
5587 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
5588}
5589impl Default for UavcanNodeHealth {
5590 fn default() -> Self {
5591 Self::DEFAULT
5592 }
5593}
5594#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5596#[cfg_attr(feature = "serde", serde(tag = "type"))]
5597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5598#[repr(u32)]
5599#[doc = "Generalized UAVCAN node mode"]
5600pub enum UavcanNodeMode {
5601 #[doc = "The node is performing its primary functions."]
5602 UAVCAN_NODE_MODE_OPERATIONAL = 0,
5603 #[doc = "The node is initializing; this mode is entered immediately after startup."]
5604 UAVCAN_NODE_MODE_INITIALIZATION = 1,
5605 #[doc = "The node is under maintenance."]
5606 UAVCAN_NODE_MODE_MAINTENANCE = 2,
5607 #[doc = "The node is in the process of updating its software."]
5608 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
5609 #[doc = "The node is no longer available online."]
5610 UAVCAN_NODE_MODE_OFFLINE = 7,
5611}
5612impl UavcanNodeMode {
5613 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
5614}
5615impl Default for UavcanNodeMode {
5616 fn default() -> Self {
5617 Self::DEFAULT
5618 }
5619}
5620#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5622#[cfg_attr(feature = "serde", serde(tag = "type"))]
5623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5624#[repr(u32)]
5625#[doc = "Emergency status encoding"]
5626pub enum UavionixAdsbEmergencyStatus {
5627 UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0,
5628 UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1,
5629 UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2,
5630 UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3,
5631 UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4,
5632 UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5,
5633 UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6,
5634 UAVIONIX_ADSB_OUT_RESERVED = 7,
5635}
5636impl UavionixAdsbEmergencyStatus {
5637 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_NO_EMERGENCY;
5638}
5639impl Default for UavionixAdsbEmergencyStatus {
5640 fn default() -> Self {
5641 Self::DEFAULT
5642 }
5643}
5644#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5646#[cfg_attr(feature = "serde", serde(tag = "type"))]
5647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5648#[repr(u32)]
5649#[doc = "Definitions for aircraft size"]
5650pub enum UavionixAdsbOutCfgAircraftSize {
5651 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0,
5652 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1,
5653 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2,
5654 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3,
5655 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4,
5656 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5,
5657 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6,
5658 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7,
5659 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8,
5660 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9,
5661 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10,
5662 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11,
5663 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12,
5664 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13,
5665 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14,
5666 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15,
5667}
5668impl UavionixAdsbOutCfgAircraftSize {
5669 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA;
5670}
5671impl Default for UavionixAdsbOutCfgAircraftSize {
5672 fn default() -> Self {
5673 Self::DEFAULT
5674 }
5675}
5676#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5678#[cfg_attr(feature = "serde", serde(tag = "type"))]
5679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5680#[repr(u32)]
5681#[doc = "GPS lataral offset encoding"]
5682pub enum UavionixAdsbOutCfgGpsOffsetLat {
5683 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0,
5684 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1,
5685 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2,
5686 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3,
5687 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4,
5688 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5,
5689 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6,
5690 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7,
5691}
5692impl UavionixAdsbOutCfgGpsOffsetLat {
5693 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA;
5694}
5695impl Default for UavionixAdsbOutCfgGpsOffsetLat {
5696 fn default() -> Self {
5697 Self::DEFAULT
5698 }
5699}
5700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5702#[cfg_attr(feature = "serde", serde(tag = "type"))]
5703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5704#[repr(u32)]
5705#[doc = "GPS longitudinal offset encoding"]
5706pub enum UavionixAdsbOutCfgGpsOffsetLon {
5707 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0,
5708 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1,
5709}
5710impl UavionixAdsbOutCfgGpsOffsetLon {
5711 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA;
5712}
5713impl Default for UavionixAdsbOutCfgGpsOffsetLon {
5714 fn default() -> Self {
5715 Self::DEFAULT
5716 }
5717}
5718bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutControlState : u8 { const UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED = 1 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_ON_GROUND = 4 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_IDENT_BUTTON_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_1090ES_TX_ENABLED = 128 ; } }
5719impl UavionixAdsbOutControlState {
5720 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED;
5721}
5722impl Default for UavionixAdsbOutControlState {
5723 fn default() -> Self {
5724 Self::DEFAULT
5725 }
5726}
5727#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5729#[cfg_attr(feature = "serde", serde(tag = "type"))]
5730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5731#[repr(u32)]
5732#[doc = "Status for ADS-B transponder dynamic input"]
5733pub enum UavionixAdsbOutDynamicGpsFix {
5734 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0,
5735 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1,
5736 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2,
5737 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3,
5738 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4,
5739 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5,
5740}
5741impl UavionixAdsbOutDynamicGpsFix {
5742 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0;
5743}
5744impl Default for UavionixAdsbOutDynamicGpsFix {
5745 fn default() -> Self {
5746 Self::DEFAULT
5747 }
5748}
5749bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutDynamicState : u16 { const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16 ; } }
5750impl UavionixAdsbOutDynamicState {
5751 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE;
5752}
5753impl Default for UavionixAdsbOutDynamicState {
5754 fn default() -> Self {
5755 Self::DEFAULT
5756 }
5757}
5758bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Transceiver RF control flags for ADS-B transponder dynamic reports"] pub struct UavionixAdsbOutRfSelect : u8 { const UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1 ; const UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2 ; } }
5759impl UavionixAdsbOutRfSelect {
5760 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED;
5761}
5762impl Default for UavionixAdsbOutRfSelect {
5763 fn default() -> Self {
5764 Self::DEFAULT
5765 }
5766}
5767bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder fault report"] pub struct UavionixAdsbOutStatusFault : u8 { const UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL = 8 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_NO_POS = 16 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_UNAVAIL = 32 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_TX_SYSTEM_FAIL = 64 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_MAINT_REQ = 128 ; } }
5768impl UavionixAdsbOutStatusFault {
5769 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL;
5770}
5771impl Default for UavionixAdsbOutStatusFault {
5772 fn default() -> Self {
5773 Self::DEFAULT
5774 }
5775}
5776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5778#[cfg_attr(feature = "serde", serde(tag = "type"))]
5779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5780#[repr(u32)]
5781#[doc = "State flags for ADS-B transponder status report"]
5782pub enum UavionixAdsbOutStatusNicNacp {
5783 UAVIONIX_ADSB_NIC_CR_20_NM = 1,
5784 UAVIONIX_ADSB_NIC_CR_8_NM = 2,
5785 UAVIONIX_ADSB_NIC_CR_4_NM = 3,
5786 UAVIONIX_ADSB_NIC_CR_2_NM = 4,
5787 UAVIONIX_ADSB_NIC_CR_1_NM = 5,
5788 UAVIONIX_ADSB_NIC_CR_0_3_NM = 6,
5789 UAVIONIX_ADSB_NIC_CR_0_2_NM = 7,
5790 UAVIONIX_ADSB_NIC_CR_0_1_NM = 8,
5791 UAVIONIX_ADSB_NIC_CR_75_M = 9,
5792 UAVIONIX_ADSB_NIC_CR_25_M = 10,
5793 UAVIONIX_ADSB_NIC_CR_7_5_M = 11,
5794 UAVIONIX_ADSB_NACP_EPU_10_NM = 16,
5795 UAVIONIX_ADSB_NACP_EPU_4_NM = 32,
5796 UAVIONIX_ADSB_NACP_EPU_2_NM = 48,
5797 UAVIONIX_ADSB_NACP_EPU_1_NM = 64,
5798 UAVIONIX_ADSB_NACP_EPU_0_5_NM = 80,
5799 UAVIONIX_ADSB_NACP_EPU_0_3_NM = 96,
5800 UAVIONIX_ADSB_NACP_EPU_0_1_NM = 112,
5801 UAVIONIX_ADSB_NACP_EPU_0_05_NM = 128,
5802 UAVIONIX_ADSB_NACP_EPU_30_M = 144,
5803 UAVIONIX_ADSB_NACP_EPU_10_M = 160,
5804 UAVIONIX_ADSB_NACP_EPU_3_M = 176,
5805}
5806impl UavionixAdsbOutStatusNicNacp {
5807 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_NIC_CR_20_NM;
5808}
5809impl Default for UavionixAdsbOutStatusNicNacp {
5810 fn default() -> Self {
5811 Self::DEFAULT
5812 }
5813}
5814bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder status report"] pub struct UavionixAdsbOutStatusState : u8 { const UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND = 1 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_INTERROGATED_SINCE_LAST = 2 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_XBIT_ENABLED = 4 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_IDENT_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_1090ES_TX_ENABLED = 128 ; } }
5815impl UavionixAdsbOutStatusState {
5816 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND;
5817}
5818impl Default for UavionixAdsbOutStatusState {
5819 fn default() -> Self {
5820 Self::DEFAULT
5821 }
5822}
5823bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Status flags for ADS-B transponder dynamic output"] pub struct UavionixAdsbRfHealth : u8 { const UAVIONIX_ADSB_RF_HEALTH_OK = 1 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16 ; } }
5824impl UavionixAdsbRfHealth {
5825 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_RF_HEALTH_OK;
5826}
5827impl Default for UavionixAdsbRfHealth {
5828 fn default() -> Self {
5829 Self::DEFAULT
5830 }
5831}
5832bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for X-Bit and reserved fields."] pub struct UavionixAdsbXbit : u8 { const UAVIONIX_ADSB_XBIT_ENABLED = 128 ; } }
5833impl UavionixAdsbXbit {
5834 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_XBIT_ENABLED;
5835}
5836impl Default for UavionixAdsbXbit {
5837 fn default() -> Self {
5838 Self::DEFAULT
5839 }
5840}
5841bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
5842impl UtmDataAvailFlags {
5843 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
5844}
5845impl Default for UtmDataAvailFlags {
5846 fn default() -> Self {
5847 Self::DEFAULT
5848 }
5849}
5850#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5852#[cfg_attr(feature = "serde", serde(tag = "type"))]
5853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5854#[repr(u32)]
5855#[doc = "Airborne status of UAS."]
5856pub enum UtmFlightState {
5857 #[doc = "The flight state can't be determined."]
5858 UTM_FLIGHT_STATE_UNKNOWN = 1,
5859 #[doc = "UAS on ground."]
5860 UTM_FLIGHT_STATE_GROUND = 2,
5861 #[doc = "UAS airborne."]
5862 UTM_FLIGHT_STATE_AIRBORNE = 3,
5863 #[doc = "UAS is in an emergency flight state."]
5864 UTM_FLIGHT_STATE_EMERGENCY = 16,
5865 #[doc = "UAS has no active controls."]
5866 UTM_FLIGHT_STATE_NOCTRL = 32,
5867}
5868impl UtmFlightState {
5869 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
5870}
5871impl Default for UtmFlightState {
5872 fn default() -> Self {
5873 Self::DEFAULT
5874 }
5875}
5876#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5878#[cfg_attr(feature = "serde", serde(tag = "type"))]
5879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5880#[repr(u32)]
5881#[doc = "Video stream encodings"]
5882pub enum VideoStreamEncoding {
5883 #[doc = "Stream encoding is unknown"]
5884 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
5885 #[doc = "Stream encoding is H.264"]
5886 VIDEO_STREAM_ENCODING_H264 = 1,
5887 #[doc = "Stream encoding is H.265"]
5888 VIDEO_STREAM_ENCODING_H265 = 2,
5889}
5890impl VideoStreamEncoding {
5891 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
5892}
5893impl Default for VideoStreamEncoding {
5894 fn default() -> Self {
5895 Self::DEFAULT
5896 }
5897}
5898bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
5899impl VideoStreamStatusFlags {
5900 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
5901}
5902impl Default for VideoStreamStatusFlags {
5903 fn default() -> Self {
5904 Self::DEFAULT
5905 }
5906}
5907#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5909#[cfg_attr(feature = "serde", serde(tag = "type"))]
5910#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5911#[repr(u32)]
5912#[doc = "Video stream types"]
5913pub enum VideoStreamType {
5914 #[doc = "Stream is RTSP"]
5915 VIDEO_STREAM_TYPE_RTSP = 0,
5916 #[doc = "Stream is RTP UDP (URI gives the port number)"]
5917 VIDEO_STREAM_TYPE_RTPUDP = 1,
5918 #[doc = "Stream is MPEG on TCP"]
5919 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
5920 #[doc = "Stream is MPEG TS (URI gives the port number)"]
5921 VIDEO_STREAM_TYPE_MPEG_TS = 3,
5922}
5923impl VideoStreamType {
5924 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
5925}
5926impl Default for VideoStreamType {
5927 fn default() -> Self {
5928 Self::DEFAULT
5929 }
5930}
5931#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5933#[cfg_attr(feature = "serde", serde(tag = "type"))]
5934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5935#[repr(u32)]
5936#[doc = "Direction of VTOL transition"]
5937pub enum VtolTransitionHeading {
5938 #[doc = "Respect the heading configuration of the vehicle."]
5939 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
5940 #[doc = "Use the heading pointing towards the next waypoint."]
5941 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
5942 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
5943 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
5944 #[doc = "Use the specified heading in parameter 4."]
5945 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
5946 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
5947 VTOL_TRANSITION_HEADING_ANY = 4,
5948}
5949impl VtolTransitionHeading {
5950 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
5951}
5952impl Default for VtolTransitionHeading {
5953 fn default() -> Self {
5954 Self::DEFAULT
5955 }
5956}
5957#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5958#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5959#[cfg_attr(feature = "serde", serde(tag = "type"))]
5960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5961#[repr(u32)]
5962#[doc = "WiFi Mode."]
5963pub enum WifiConfigApMode {
5964 #[doc = "WiFi mode is undefined."]
5965 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
5966 #[doc = "WiFi configured as an access point."]
5967 WIFI_CONFIG_AP_MODE_AP = 1,
5968 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
5969 WIFI_CONFIG_AP_MODE_STATION = 2,
5970 #[doc = "WiFi disabled."]
5971 WIFI_CONFIG_AP_MODE_DISABLED = 3,
5972}
5973impl WifiConfigApMode {
5974 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
5975}
5976impl Default for WifiConfigApMode {
5977 fn default() -> Self {
5978 Self::DEFAULT
5979 }
5980}
5981#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
5982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5983#[cfg_attr(feature = "serde", serde(tag = "type"))]
5984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5985#[repr(u32)]
5986#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
5987pub enum WifiConfigApResponse {
5988 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
5989 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
5990 #[doc = "Changes accepted."]
5991 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
5992 #[doc = "Changes rejected."]
5993 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
5994 #[doc = "Invalid Mode."]
5995 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
5996 #[doc = "Invalid SSID."]
5997 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
5998 #[doc = "Invalid Password."]
5999 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
6000}
6001impl WifiConfigApResponse {
6002 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
6003}
6004impl Default for WifiConfigApResponse {
6005 fn default() -> Self {
6006 Self::DEFAULT
6007 }
6008}
6009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
6010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6011#[cfg_attr(feature = "serde", serde(tag = "type"))]
6012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6013#[repr(u32)]
6014#[doc = "Winch actions."]
6015pub enum WinchActions {
6016 #[doc = "Allow motor to freewheel."]
6017 WINCH_RELAXED = 0,
6018 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
6019 WINCH_RELATIVE_LENGTH_CONTROL = 1,
6020 #[doc = "Wind or unwind line at specified rate."]
6021 WINCH_RATE_CONTROL = 2,
6022 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
6023 WINCH_LOCK = 3,
6024 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
6025 WINCH_DELIVER = 4,
6026 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
6027 WINCH_HOLD = 5,
6028 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
6029 WINCH_RETRACT = 6,
6030 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
6031 WINCH_LOAD_LINE = 7,
6032 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
6033 WINCH_ABANDON_LINE = 8,
6034 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
6035 WINCH_LOAD_PAYLOAD = 9,
6036}
6037impl WinchActions {
6038 pub const DEFAULT: Self = Self::WINCH_RELAXED;
6039}
6040impl Default for WinchActions {
6041 fn default() -> Self {
6042 Self::DEFAULT
6043 }
6044}
6045#[doc = "id: 140"]
6046#[doc = "Set the vehicle attitude and body angular rates."]
6047#[derive(Debug, Clone, PartialEq)]
6048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6050pub struct ACTUATOR_CONTROL_TARGET_DATA {
6051 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6052 pub time_usec: u64,
6053 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
6054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6055 pub controls: [f32; 8],
6056 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
6057 pub group_mlx: u8,
6058}
6059impl ACTUATOR_CONTROL_TARGET_DATA {
6060 pub const ENCODED_LEN: usize = 41usize;
6061 pub const DEFAULT: Self = Self {
6062 time_usec: 0_u64,
6063 controls: [0.0_f32; 8usize],
6064 group_mlx: 0_u8,
6065 };
6066 #[cfg(feature = "arbitrary")]
6067 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6068 use arbitrary::{Arbitrary, Unstructured};
6069 let mut buf = [0u8; 1024];
6070 rng.fill_bytes(&mut buf);
6071 let mut unstructured = Unstructured::new(&buf);
6072 Self::arbitrary(&mut unstructured).unwrap_or_default()
6073 }
6074}
6075impl Default for ACTUATOR_CONTROL_TARGET_DATA {
6076 fn default() -> Self {
6077 Self::DEFAULT.clone()
6078 }
6079}
6080impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
6081 type Message = MavMessage;
6082 const ID: u32 = 140u32;
6083 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
6084 const EXTRA_CRC: u8 = 181u8;
6085 const ENCODED_LEN: usize = 41usize;
6086 fn deser(
6087 _version: MavlinkVersion,
6088 __input: &[u8],
6089 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6090 let avail_len = __input.len();
6091 let mut payload_buf = [0; Self::ENCODED_LEN];
6092 let mut buf = if avail_len < Self::ENCODED_LEN {
6093 payload_buf[0..avail_len].copy_from_slice(__input);
6094 Bytes::new(&payload_buf)
6095 } else {
6096 Bytes::new(__input)
6097 };
6098 let mut __struct = Self::default();
6099 __struct.time_usec = buf.get_u64_le();
6100 for v in &mut __struct.controls {
6101 let val = buf.get_f32_le();
6102 *v = val;
6103 }
6104 __struct.group_mlx = buf.get_u8();
6105 Ok(__struct)
6106 }
6107 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6108 let mut __tmp = BytesMut::new(bytes);
6109 #[allow(clippy::absurd_extreme_comparisons)]
6110 #[allow(unused_comparisons)]
6111 if __tmp.remaining() < Self::ENCODED_LEN {
6112 panic!(
6113 "buffer is too small (need {} bytes, but got {})",
6114 Self::ENCODED_LEN,
6115 __tmp.remaining(),
6116 )
6117 }
6118 __tmp.put_u64_le(self.time_usec);
6119 for val in &self.controls {
6120 __tmp.put_f32_le(*val);
6121 }
6122 __tmp.put_u8(self.group_mlx);
6123 if matches!(version, MavlinkVersion::V2) {
6124 let len = __tmp.len();
6125 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6126 } else {
6127 __tmp.len()
6128 }
6129 }
6130}
6131#[doc = "id: 375"]
6132#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
6133#[derive(Debug, Clone, PartialEq)]
6134#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6136pub struct ACTUATOR_OUTPUT_STATUS_DATA {
6137 #[doc = "Timestamp (since system boot)."]
6138 pub time_usec: u64,
6139 #[doc = "Active outputs"]
6140 pub active: u32,
6141 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
6142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6143 pub actuator: [f32; 32],
6144}
6145impl ACTUATOR_OUTPUT_STATUS_DATA {
6146 pub const ENCODED_LEN: usize = 140usize;
6147 pub const DEFAULT: Self = Self {
6148 time_usec: 0_u64,
6149 active: 0_u32,
6150 actuator: [0.0_f32; 32usize],
6151 };
6152 #[cfg(feature = "arbitrary")]
6153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6154 use arbitrary::{Arbitrary, Unstructured};
6155 let mut buf = [0u8; 1024];
6156 rng.fill_bytes(&mut buf);
6157 let mut unstructured = Unstructured::new(&buf);
6158 Self::arbitrary(&mut unstructured).unwrap_or_default()
6159 }
6160}
6161impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
6162 fn default() -> Self {
6163 Self::DEFAULT.clone()
6164 }
6165}
6166impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
6167 type Message = MavMessage;
6168 const ID: u32 = 375u32;
6169 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
6170 const EXTRA_CRC: u8 = 251u8;
6171 const ENCODED_LEN: usize = 140usize;
6172 fn deser(
6173 _version: MavlinkVersion,
6174 __input: &[u8],
6175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6176 let avail_len = __input.len();
6177 let mut payload_buf = [0; Self::ENCODED_LEN];
6178 let mut buf = if avail_len < Self::ENCODED_LEN {
6179 payload_buf[0..avail_len].copy_from_slice(__input);
6180 Bytes::new(&payload_buf)
6181 } else {
6182 Bytes::new(__input)
6183 };
6184 let mut __struct = Self::default();
6185 __struct.time_usec = buf.get_u64_le();
6186 __struct.active = buf.get_u32_le();
6187 for v in &mut __struct.actuator {
6188 let val = buf.get_f32_le();
6189 *v = val;
6190 }
6191 Ok(__struct)
6192 }
6193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6194 let mut __tmp = BytesMut::new(bytes);
6195 #[allow(clippy::absurd_extreme_comparisons)]
6196 #[allow(unused_comparisons)]
6197 if __tmp.remaining() < Self::ENCODED_LEN {
6198 panic!(
6199 "buffer is too small (need {} bytes, but got {})",
6200 Self::ENCODED_LEN,
6201 __tmp.remaining(),
6202 )
6203 }
6204 __tmp.put_u64_le(self.time_usec);
6205 __tmp.put_u32_le(self.active);
6206 for val in &self.actuator {
6207 __tmp.put_f32_le(*val);
6208 }
6209 if matches!(version, MavlinkVersion::V2) {
6210 let len = __tmp.len();
6211 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6212 } else {
6213 __tmp.len()
6214 }
6215 }
6216}
6217#[doc = "id: 11010"]
6218#[doc = "Adaptive Controller tuning information."]
6219#[derive(Debug, Clone, PartialEq)]
6220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6222pub struct ADAP_TUNING_DATA {
6223 #[doc = "Desired rate."]
6224 pub desired: f32,
6225 #[doc = "Achieved rate."]
6226 pub achieved: f32,
6227 #[doc = "Error between model and vehicle."]
6228 pub error: f32,
6229 #[doc = "Theta estimated state predictor."]
6230 pub theta: f32,
6231 #[doc = "Omega estimated state predictor."]
6232 pub omega: f32,
6233 #[doc = "Sigma estimated state predictor."]
6234 pub sigma: f32,
6235 #[doc = "Theta derivative."]
6236 pub theta_dot: f32,
6237 #[doc = "Omega derivative."]
6238 pub omega_dot: f32,
6239 #[doc = "Sigma derivative."]
6240 pub sigma_dot: f32,
6241 #[doc = "Projection operator value."]
6242 pub f: f32,
6243 #[doc = "Projection operator derivative."]
6244 pub f_dot: f32,
6245 #[doc = "u adaptive controlled output command."]
6246 pub u: f32,
6247 #[doc = "Axis."]
6248 pub axis: PidTuningAxis,
6249}
6250impl ADAP_TUNING_DATA {
6251 pub const ENCODED_LEN: usize = 49usize;
6252 pub const DEFAULT: Self = Self {
6253 desired: 0.0_f32,
6254 achieved: 0.0_f32,
6255 error: 0.0_f32,
6256 theta: 0.0_f32,
6257 omega: 0.0_f32,
6258 sigma: 0.0_f32,
6259 theta_dot: 0.0_f32,
6260 omega_dot: 0.0_f32,
6261 sigma_dot: 0.0_f32,
6262 f: 0.0_f32,
6263 f_dot: 0.0_f32,
6264 u: 0.0_f32,
6265 axis: PidTuningAxis::DEFAULT,
6266 };
6267 #[cfg(feature = "arbitrary")]
6268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6269 use arbitrary::{Arbitrary, Unstructured};
6270 let mut buf = [0u8; 1024];
6271 rng.fill_bytes(&mut buf);
6272 let mut unstructured = Unstructured::new(&buf);
6273 Self::arbitrary(&mut unstructured).unwrap_or_default()
6274 }
6275}
6276impl Default for ADAP_TUNING_DATA {
6277 fn default() -> Self {
6278 Self::DEFAULT.clone()
6279 }
6280}
6281impl MessageData for ADAP_TUNING_DATA {
6282 type Message = MavMessage;
6283 const ID: u32 = 11010u32;
6284 const NAME: &'static str = "ADAP_TUNING";
6285 const EXTRA_CRC: u8 = 46u8;
6286 const ENCODED_LEN: usize = 49usize;
6287 fn deser(
6288 _version: MavlinkVersion,
6289 __input: &[u8],
6290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6291 let avail_len = __input.len();
6292 let mut payload_buf = [0; Self::ENCODED_LEN];
6293 let mut buf = if avail_len < Self::ENCODED_LEN {
6294 payload_buf[0..avail_len].copy_from_slice(__input);
6295 Bytes::new(&payload_buf)
6296 } else {
6297 Bytes::new(__input)
6298 };
6299 let mut __struct = Self::default();
6300 __struct.desired = buf.get_f32_le();
6301 __struct.achieved = buf.get_f32_le();
6302 __struct.error = buf.get_f32_le();
6303 __struct.theta = buf.get_f32_le();
6304 __struct.omega = buf.get_f32_le();
6305 __struct.sigma = buf.get_f32_le();
6306 __struct.theta_dot = buf.get_f32_le();
6307 __struct.omega_dot = buf.get_f32_le();
6308 __struct.sigma_dot = buf.get_f32_le();
6309 __struct.f = buf.get_f32_le();
6310 __struct.f_dot = buf.get_f32_le();
6311 __struct.u = buf.get_f32_le();
6312 let tmp = buf.get_u8();
6313 __struct.axis =
6314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6315 enum_type: "PidTuningAxis",
6316 value: tmp as u32,
6317 })?;
6318 Ok(__struct)
6319 }
6320 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6321 let mut __tmp = BytesMut::new(bytes);
6322 #[allow(clippy::absurd_extreme_comparisons)]
6323 #[allow(unused_comparisons)]
6324 if __tmp.remaining() < Self::ENCODED_LEN {
6325 panic!(
6326 "buffer is too small (need {} bytes, but got {})",
6327 Self::ENCODED_LEN,
6328 __tmp.remaining(),
6329 )
6330 }
6331 __tmp.put_f32_le(self.desired);
6332 __tmp.put_f32_le(self.achieved);
6333 __tmp.put_f32_le(self.error);
6334 __tmp.put_f32_le(self.theta);
6335 __tmp.put_f32_le(self.omega);
6336 __tmp.put_f32_le(self.sigma);
6337 __tmp.put_f32_le(self.theta_dot);
6338 __tmp.put_f32_le(self.omega_dot);
6339 __tmp.put_f32_le(self.sigma_dot);
6340 __tmp.put_f32_le(self.f);
6341 __tmp.put_f32_le(self.f_dot);
6342 __tmp.put_f32_le(self.u);
6343 __tmp.put_u8(self.axis as u8);
6344 if matches!(version, MavlinkVersion::V2) {
6345 let len = __tmp.len();
6346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6347 } else {
6348 __tmp.len()
6349 }
6350 }
6351}
6352#[doc = "id: 246"]
6353#[doc = "The location and information of an ADSB vehicle."]
6354#[derive(Debug, Clone, PartialEq)]
6355#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6357pub struct ADSB_VEHICLE_DATA {
6358 #[doc = "ICAO address"]
6359 pub ICAO_address: u32,
6360 #[doc = "Latitude"]
6361 pub lat: i32,
6362 #[doc = "Longitude"]
6363 pub lon: i32,
6364 #[doc = "Altitude(ASL)"]
6365 pub altitude: i32,
6366 #[doc = "Course over ground"]
6367 pub heading: u16,
6368 #[doc = "The horizontal velocity"]
6369 pub hor_velocity: u16,
6370 #[doc = "The vertical velocity. Positive is up"]
6371 pub ver_velocity: i16,
6372 #[doc = "Bitmap to indicate various statuses including valid data fields"]
6373 pub flags: AdsbFlags,
6374 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
6375 pub squawk: u16,
6376 #[doc = "ADSB altitude type."]
6377 pub altitude_type: AdsbAltitudeType,
6378 #[doc = "The callsign, 8+null"]
6379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6380 pub callsign: [u8; 9],
6381 #[doc = "ADSB emitter type."]
6382 pub emitter_type: AdsbEmitterType,
6383 #[doc = "Time since last communication in seconds"]
6384 pub tslc: u8,
6385}
6386impl ADSB_VEHICLE_DATA {
6387 pub const ENCODED_LEN: usize = 38usize;
6388 pub const DEFAULT: Self = Self {
6389 ICAO_address: 0_u32,
6390 lat: 0_i32,
6391 lon: 0_i32,
6392 altitude: 0_i32,
6393 heading: 0_u16,
6394 hor_velocity: 0_u16,
6395 ver_velocity: 0_i16,
6396 flags: AdsbFlags::DEFAULT,
6397 squawk: 0_u16,
6398 altitude_type: AdsbAltitudeType::DEFAULT,
6399 callsign: [0_u8; 9usize],
6400 emitter_type: AdsbEmitterType::DEFAULT,
6401 tslc: 0_u8,
6402 };
6403 #[cfg(feature = "arbitrary")]
6404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6405 use arbitrary::{Arbitrary, Unstructured};
6406 let mut buf = [0u8; 1024];
6407 rng.fill_bytes(&mut buf);
6408 let mut unstructured = Unstructured::new(&buf);
6409 Self::arbitrary(&mut unstructured).unwrap_or_default()
6410 }
6411}
6412impl Default for ADSB_VEHICLE_DATA {
6413 fn default() -> Self {
6414 Self::DEFAULT.clone()
6415 }
6416}
6417impl MessageData for ADSB_VEHICLE_DATA {
6418 type Message = MavMessage;
6419 const ID: u32 = 246u32;
6420 const NAME: &'static str = "ADSB_VEHICLE";
6421 const EXTRA_CRC: u8 = 184u8;
6422 const ENCODED_LEN: usize = 38usize;
6423 fn deser(
6424 _version: MavlinkVersion,
6425 __input: &[u8],
6426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6427 let avail_len = __input.len();
6428 let mut payload_buf = [0; Self::ENCODED_LEN];
6429 let mut buf = if avail_len < Self::ENCODED_LEN {
6430 payload_buf[0..avail_len].copy_from_slice(__input);
6431 Bytes::new(&payload_buf)
6432 } else {
6433 Bytes::new(__input)
6434 };
6435 let mut __struct = Self::default();
6436 __struct.ICAO_address = buf.get_u32_le();
6437 __struct.lat = buf.get_i32_le();
6438 __struct.lon = buf.get_i32_le();
6439 __struct.altitude = buf.get_i32_le();
6440 __struct.heading = buf.get_u16_le();
6441 __struct.hor_velocity = buf.get_u16_le();
6442 __struct.ver_velocity = buf.get_i16_le();
6443 let tmp = buf.get_u16_le();
6444 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
6445 ::mavlink_core::error::ParserError::InvalidFlag {
6446 flag_type: "AdsbFlags",
6447 value: tmp as u32,
6448 },
6449 )?;
6450 __struct.squawk = buf.get_u16_le();
6451 let tmp = buf.get_u8();
6452 __struct.altitude_type =
6453 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6454 enum_type: "AdsbAltitudeType",
6455 value: tmp as u32,
6456 })?;
6457 for v in &mut __struct.callsign {
6458 let val = buf.get_u8();
6459 *v = val;
6460 }
6461 let tmp = buf.get_u8();
6462 __struct.emitter_type =
6463 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6464 enum_type: "AdsbEmitterType",
6465 value: tmp as u32,
6466 })?;
6467 __struct.tslc = buf.get_u8();
6468 Ok(__struct)
6469 }
6470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6471 let mut __tmp = BytesMut::new(bytes);
6472 #[allow(clippy::absurd_extreme_comparisons)]
6473 #[allow(unused_comparisons)]
6474 if __tmp.remaining() < Self::ENCODED_LEN {
6475 panic!(
6476 "buffer is too small (need {} bytes, but got {})",
6477 Self::ENCODED_LEN,
6478 __tmp.remaining(),
6479 )
6480 }
6481 __tmp.put_u32_le(self.ICAO_address);
6482 __tmp.put_i32_le(self.lat);
6483 __tmp.put_i32_le(self.lon);
6484 __tmp.put_i32_le(self.altitude);
6485 __tmp.put_u16_le(self.heading);
6486 __tmp.put_u16_le(self.hor_velocity);
6487 __tmp.put_i16_le(self.ver_velocity);
6488 __tmp.put_u16_le(self.flags.bits());
6489 __tmp.put_u16_le(self.squawk);
6490 __tmp.put_u8(self.altitude_type as u8);
6491 for val in &self.callsign {
6492 __tmp.put_u8(*val);
6493 }
6494 __tmp.put_u8(self.emitter_type as u8);
6495 __tmp.put_u8(self.tslc);
6496 if matches!(version, MavlinkVersion::V2) {
6497 let len = __tmp.len();
6498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6499 } else {
6500 __tmp.len()
6501 }
6502 }
6503}
6504#[doc = "id: 163"]
6505#[doc = "Status of DCM attitude estimator."]
6506#[derive(Debug, Clone, PartialEq)]
6507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6509pub struct AHRS_DATA {
6510 #[doc = "X gyro drift estimate."]
6511 pub omegaIx: f32,
6512 #[doc = "Y gyro drift estimate."]
6513 pub omegaIy: f32,
6514 #[doc = "Z gyro drift estimate."]
6515 pub omegaIz: f32,
6516 #[doc = "Average accel_weight."]
6517 pub accel_weight: f32,
6518 #[doc = "Average renormalisation value."]
6519 pub renorm_val: f32,
6520 #[doc = "Average error_roll_pitch value."]
6521 pub error_rp: f32,
6522 #[doc = "Average error_yaw value."]
6523 pub error_yaw: f32,
6524}
6525impl AHRS_DATA {
6526 pub const ENCODED_LEN: usize = 28usize;
6527 pub const DEFAULT: Self = Self {
6528 omegaIx: 0.0_f32,
6529 omegaIy: 0.0_f32,
6530 omegaIz: 0.0_f32,
6531 accel_weight: 0.0_f32,
6532 renorm_val: 0.0_f32,
6533 error_rp: 0.0_f32,
6534 error_yaw: 0.0_f32,
6535 };
6536 #[cfg(feature = "arbitrary")]
6537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6538 use arbitrary::{Arbitrary, Unstructured};
6539 let mut buf = [0u8; 1024];
6540 rng.fill_bytes(&mut buf);
6541 let mut unstructured = Unstructured::new(&buf);
6542 Self::arbitrary(&mut unstructured).unwrap_or_default()
6543 }
6544}
6545impl Default for AHRS_DATA {
6546 fn default() -> Self {
6547 Self::DEFAULT.clone()
6548 }
6549}
6550impl MessageData for AHRS_DATA {
6551 type Message = MavMessage;
6552 const ID: u32 = 163u32;
6553 const NAME: &'static str = "AHRS";
6554 const EXTRA_CRC: u8 = 127u8;
6555 const ENCODED_LEN: usize = 28usize;
6556 fn deser(
6557 _version: MavlinkVersion,
6558 __input: &[u8],
6559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6560 let avail_len = __input.len();
6561 let mut payload_buf = [0; Self::ENCODED_LEN];
6562 let mut buf = if avail_len < Self::ENCODED_LEN {
6563 payload_buf[0..avail_len].copy_from_slice(__input);
6564 Bytes::new(&payload_buf)
6565 } else {
6566 Bytes::new(__input)
6567 };
6568 let mut __struct = Self::default();
6569 __struct.omegaIx = buf.get_f32_le();
6570 __struct.omegaIy = buf.get_f32_le();
6571 __struct.omegaIz = buf.get_f32_le();
6572 __struct.accel_weight = buf.get_f32_le();
6573 __struct.renorm_val = buf.get_f32_le();
6574 __struct.error_rp = buf.get_f32_le();
6575 __struct.error_yaw = buf.get_f32_le();
6576 Ok(__struct)
6577 }
6578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6579 let mut __tmp = BytesMut::new(bytes);
6580 #[allow(clippy::absurd_extreme_comparisons)]
6581 #[allow(unused_comparisons)]
6582 if __tmp.remaining() < Self::ENCODED_LEN {
6583 panic!(
6584 "buffer is too small (need {} bytes, but got {})",
6585 Self::ENCODED_LEN,
6586 __tmp.remaining(),
6587 )
6588 }
6589 __tmp.put_f32_le(self.omegaIx);
6590 __tmp.put_f32_le(self.omegaIy);
6591 __tmp.put_f32_le(self.omegaIz);
6592 __tmp.put_f32_le(self.accel_weight);
6593 __tmp.put_f32_le(self.renorm_val);
6594 __tmp.put_f32_le(self.error_rp);
6595 __tmp.put_f32_le(self.error_yaw);
6596 if matches!(version, MavlinkVersion::V2) {
6597 let len = __tmp.len();
6598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6599 } else {
6600 __tmp.len()
6601 }
6602 }
6603}
6604#[doc = "id: 178"]
6605#[doc = "Status of secondary AHRS filter if available."]
6606#[derive(Debug, Clone, PartialEq)]
6607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6609pub struct AHRS2_DATA {
6610 #[doc = "Roll angle."]
6611 pub roll: f32,
6612 #[doc = "Pitch angle."]
6613 pub pitch: f32,
6614 #[doc = "Yaw angle."]
6615 pub yaw: f32,
6616 #[doc = "Altitude (MSL)."]
6617 pub altitude: f32,
6618 #[doc = "Latitude."]
6619 pub lat: i32,
6620 #[doc = "Longitude."]
6621 pub lng: i32,
6622}
6623impl AHRS2_DATA {
6624 pub const ENCODED_LEN: usize = 24usize;
6625 pub const DEFAULT: Self = Self {
6626 roll: 0.0_f32,
6627 pitch: 0.0_f32,
6628 yaw: 0.0_f32,
6629 altitude: 0.0_f32,
6630 lat: 0_i32,
6631 lng: 0_i32,
6632 };
6633 #[cfg(feature = "arbitrary")]
6634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6635 use arbitrary::{Arbitrary, Unstructured};
6636 let mut buf = [0u8; 1024];
6637 rng.fill_bytes(&mut buf);
6638 let mut unstructured = Unstructured::new(&buf);
6639 Self::arbitrary(&mut unstructured).unwrap_or_default()
6640 }
6641}
6642impl Default for AHRS2_DATA {
6643 fn default() -> Self {
6644 Self::DEFAULT.clone()
6645 }
6646}
6647impl MessageData for AHRS2_DATA {
6648 type Message = MavMessage;
6649 const ID: u32 = 178u32;
6650 const NAME: &'static str = "AHRS2";
6651 const EXTRA_CRC: u8 = 47u8;
6652 const ENCODED_LEN: usize = 24usize;
6653 fn deser(
6654 _version: MavlinkVersion,
6655 __input: &[u8],
6656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6657 let avail_len = __input.len();
6658 let mut payload_buf = [0; Self::ENCODED_LEN];
6659 let mut buf = if avail_len < Self::ENCODED_LEN {
6660 payload_buf[0..avail_len].copy_from_slice(__input);
6661 Bytes::new(&payload_buf)
6662 } else {
6663 Bytes::new(__input)
6664 };
6665 let mut __struct = Self::default();
6666 __struct.roll = buf.get_f32_le();
6667 __struct.pitch = buf.get_f32_le();
6668 __struct.yaw = buf.get_f32_le();
6669 __struct.altitude = buf.get_f32_le();
6670 __struct.lat = buf.get_i32_le();
6671 __struct.lng = buf.get_i32_le();
6672 Ok(__struct)
6673 }
6674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6675 let mut __tmp = BytesMut::new(bytes);
6676 #[allow(clippy::absurd_extreme_comparisons)]
6677 #[allow(unused_comparisons)]
6678 if __tmp.remaining() < Self::ENCODED_LEN {
6679 panic!(
6680 "buffer is too small (need {} bytes, but got {})",
6681 Self::ENCODED_LEN,
6682 __tmp.remaining(),
6683 )
6684 }
6685 __tmp.put_f32_le(self.roll);
6686 __tmp.put_f32_le(self.pitch);
6687 __tmp.put_f32_le(self.yaw);
6688 __tmp.put_f32_le(self.altitude);
6689 __tmp.put_i32_le(self.lat);
6690 __tmp.put_i32_le(self.lng);
6691 if matches!(version, MavlinkVersion::V2) {
6692 let len = __tmp.len();
6693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6694 } else {
6695 __tmp.len()
6696 }
6697 }
6698}
6699#[doc = "id: 182"]
6700#[doc = "Status of third AHRS filter if available. This is for ANU research group (Ali and Sean)."]
6701#[derive(Debug, Clone, PartialEq)]
6702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6704pub struct AHRS3_DATA {
6705 #[doc = "Roll angle."]
6706 pub roll: f32,
6707 #[doc = "Pitch angle."]
6708 pub pitch: f32,
6709 #[doc = "Yaw angle."]
6710 pub yaw: f32,
6711 #[doc = "Altitude (MSL)."]
6712 pub altitude: f32,
6713 #[doc = "Latitude."]
6714 pub lat: i32,
6715 #[doc = "Longitude."]
6716 pub lng: i32,
6717 #[doc = "Test variable1."]
6718 pub v1: f32,
6719 #[doc = "Test variable2."]
6720 pub v2: f32,
6721 #[doc = "Test variable3."]
6722 pub v3: f32,
6723 #[doc = "Test variable4."]
6724 pub v4: f32,
6725}
6726impl AHRS3_DATA {
6727 pub const ENCODED_LEN: usize = 40usize;
6728 pub const DEFAULT: Self = Self {
6729 roll: 0.0_f32,
6730 pitch: 0.0_f32,
6731 yaw: 0.0_f32,
6732 altitude: 0.0_f32,
6733 lat: 0_i32,
6734 lng: 0_i32,
6735 v1: 0.0_f32,
6736 v2: 0.0_f32,
6737 v3: 0.0_f32,
6738 v4: 0.0_f32,
6739 };
6740 #[cfg(feature = "arbitrary")]
6741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6742 use arbitrary::{Arbitrary, Unstructured};
6743 let mut buf = [0u8; 1024];
6744 rng.fill_bytes(&mut buf);
6745 let mut unstructured = Unstructured::new(&buf);
6746 Self::arbitrary(&mut unstructured).unwrap_or_default()
6747 }
6748}
6749impl Default for AHRS3_DATA {
6750 fn default() -> Self {
6751 Self::DEFAULT.clone()
6752 }
6753}
6754impl MessageData for AHRS3_DATA {
6755 type Message = MavMessage;
6756 const ID: u32 = 182u32;
6757 const NAME: &'static str = "AHRS3";
6758 const EXTRA_CRC: u8 = 229u8;
6759 const ENCODED_LEN: usize = 40usize;
6760 fn deser(
6761 _version: MavlinkVersion,
6762 __input: &[u8],
6763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6764 let avail_len = __input.len();
6765 let mut payload_buf = [0; Self::ENCODED_LEN];
6766 let mut buf = if avail_len < Self::ENCODED_LEN {
6767 payload_buf[0..avail_len].copy_from_slice(__input);
6768 Bytes::new(&payload_buf)
6769 } else {
6770 Bytes::new(__input)
6771 };
6772 let mut __struct = Self::default();
6773 __struct.roll = buf.get_f32_le();
6774 __struct.pitch = buf.get_f32_le();
6775 __struct.yaw = buf.get_f32_le();
6776 __struct.altitude = buf.get_f32_le();
6777 __struct.lat = buf.get_i32_le();
6778 __struct.lng = buf.get_i32_le();
6779 __struct.v1 = buf.get_f32_le();
6780 __struct.v2 = buf.get_f32_le();
6781 __struct.v3 = buf.get_f32_le();
6782 __struct.v4 = buf.get_f32_le();
6783 Ok(__struct)
6784 }
6785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6786 let mut __tmp = BytesMut::new(bytes);
6787 #[allow(clippy::absurd_extreme_comparisons)]
6788 #[allow(unused_comparisons)]
6789 if __tmp.remaining() < Self::ENCODED_LEN {
6790 panic!(
6791 "buffer is too small (need {} bytes, but got {})",
6792 Self::ENCODED_LEN,
6793 __tmp.remaining(),
6794 )
6795 }
6796 __tmp.put_f32_le(self.roll);
6797 __tmp.put_f32_le(self.pitch);
6798 __tmp.put_f32_le(self.yaw);
6799 __tmp.put_f32_le(self.altitude);
6800 __tmp.put_i32_le(self.lat);
6801 __tmp.put_i32_le(self.lng);
6802 __tmp.put_f32_le(self.v1);
6803 __tmp.put_f32_le(self.v2);
6804 __tmp.put_f32_le(self.v3);
6805 __tmp.put_f32_le(self.v4);
6806 if matches!(version, MavlinkVersion::V2) {
6807 let len = __tmp.len();
6808 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6809 } else {
6810 __tmp.len()
6811 }
6812 }
6813}
6814#[doc = "id: 52000"]
6815#[doc = "Authorization package."]
6816#[derive(Debug, Clone, PartialEq)]
6817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6819pub struct AIRLINK_AUTH_DATA {
6820 #[doc = "Login"]
6821 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6822 pub login: [u8; 50],
6823 #[doc = "Password"]
6824 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6825 pub password: [u8; 50],
6826}
6827impl AIRLINK_AUTH_DATA {
6828 pub const ENCODED_LEN: usize = 100usize;
6829 pub const DEFAULT: Self = Self {
6830 login: [0_u8; 50usize],
6831 password: [0_u8; 50usize],
6832 };
6833 #[cfg(feature = "arbitrary")]
6834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6835 use arbitrary::{Arbitrary, Unstructured};
6836 let mut buf = [0u8; 1024];
6837 rng.fill_bytes(&mut buf);
6838 let mut unstructured = Unstructured::new(&buf);
6839 Self::arbitrary(&mut unstructured).unwrap_or_default()
6840 }
6841}
6842impl Default for AIRLINK_AUTH_DATA {
6843 fn default() -> Self {
6844 Self::DEFAULT.clone()
6845 }
6846}
6847impl MessageData for AIRLINK_AUTH_DATA {
6848 type Message = MavMessage;
6849 const ID: u32 = 52000u32;
6850 const NAME: &'static str = "AIRLINK_AUTH";
6851 const EXTRA_CRC: u8 = 13u8;
6852 const ENCODED_LEN: usize = 100usize;
6853 fn deser(
6854 _version: MavlinkVersion,
6855 __input: &[u8],
6856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6857 let avail_len = __input.len();
6858 let mut payload_buf = [0; Self::ENCODED_LEN];
6859 let mut buf = if avail_len < Self::ENCODED_LEN {
6860 payload_buf[0..avail_len].copy_from_slice(__input);
6861 Bytes::new(&payload_buf)
6862 } else {
6863 Bytes::new(__input)
6864 };
6865 let mut __struct = Self::default();
6866 for v in &mut __struct.login {
6867 let val = buf.get_u8();
6868 *v = val;
6869 }
6870 for v in &mut __struct.password {
6871 let val = buf.get_u8();
6872 *v = val;
6873 }
6874 Ok(__struct)
6875 }
6876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6877 let mut __tmp = BytesMut::new(bytes);
6878 #[allow(clippy::absurd_extreme_comparisons)]
6879 #[allow(unused_comparisons)]
6880 if __tmp.remaining() < Self::ENCODED_LEN {
6881 panic!(
6882 "buffer is too small (need {} bytes, but got {})",
6883 Self::ENCODED_LEN,
6884 __tmp.remaining(),
6885 )
6886 }
6887 for val in &self.login {
6888 __tmp.put_u8(*val);
6889 }
6890 for val in &self.password {
6891 __tmp.put_u8(*val);
6892 }
6893 if matches!(version, MavlinkVersion::V2) {
6894 let len = __tmp.len();
6895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6896 } else {
6897 __tmp.len()
6898 }
6899 }
6900}
6901#[doc = "id: 52001"]
6902#[doc = "Response to the authorization request."]
6903#[derive(Debug, Clone, PartialEq)]
6904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6906pub struct AIRLINK_AUTH_RESPONSE_DATA {
6907 #[doc = "Response type"]
6908 pub resp_type: AirlinkAuthResponseType,
6909}
6910impl AIRLINK_AUTH_RESPONSE_DATA {
6911 pub const ENCODED_LEN: usize = 1usize;
6912 pub const DEFAULT: Self = Self {
6913 resp_type: AirlinkAuthResponseType::DEFAULT,
6914 };
6915 #[cfg(feature = "arbitrary")]
6916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6917 use arbitrary::{Arbitrary, Unstructured};
6918 let mut buf = [0u8; 1024];
6919 rng.fill_bytes(&mut buf);
6920 let mut unstructured = Unstructured::new(&buf);
6921 Self::arbitrary(&mut unstructured).unwrap_or_default()
6922 }
6923}
6924impl Default for AIRLINK_AUTH_RESPONSE_DATA {
6925 fn default() -> Self {
6926 Self::DEFAULT.clone()
6927 }
6928}
6929impl MessageData for AIRLINK_AUTH_RESPONSE_DATA {
6930 type Message = MavMessage;
6931 const ID: u32 = 52001u32;
6932 const NAME: &'static str = "AIRLINK_AUTH_RESPONSE";
6933 const EXTRA_CRC: u8 = 239u8;
6934 const ENCODED_LEN: usize = 1usize;
6935 fn deser(
6936 _version: MavlinkVersion,
6937 __input: &[u8],
6938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6939 let avail_len = __input.len();
6940 let mut payload_buf = [0; Self::ENCODED_LEN];
6941 let mut buf = if avail_len < Self::ENCODED_LEN {
6942 payload_buf[0..avail_len].copy_from_slice(__input);
6943 Bytes::new(&payload_buf)
6944 } else {
6945 Bytes::new(__input)
6946 };
6947 let mut __struct = Self::default();
6948 let tmp = buf.get_u8();
6949 __struct.resp_type =
6950 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6951 enum_type: "AirlinkAuthResponseType",
6952 value: tmp as u32,
6953 })?;
6954 Ok(__struct)
6955 }
6956 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6957 let mut __tmp = BytesMut::new(bytes);
6958 #[allow(clippy::absurd_extreme_comparisons)]
6959 #[allow(unused_comparisons)]
6960 if __tmp.remaining() < Self::ENCODED_LEN {
6961 panic!(
6962 "buffer is too small (need {} bytes, but got {})",
6963 Self::ENCODED_LEN,
6964 __tmp.remaining(),
6965 )
6966 }
6967 __tmp.put_u8(self.resp_type as u8);
6968 if matches!(version, MavlinkVersion::V2) {
6969 let len = __tmp.len();
6970 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6971 } else {
6972 __tmp.len()
6973 }
6974 }
6975}
6976#[doc = "id: 174"]
6977#[doc = "Airspeed auto-calibration."]
6978#[derive(Debug, Clone, PartialEq)]
6979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6981pub struct AIRSPEED_AUTOCAL_DATA {
6982 #[doc = "GPS velocity north."]
6983 pub vx: f32,
6984 #[doc = "GPS velocity east."]
6985 pub vy: f32,
6986 #[doc = "GPS velocity down."]
6987 pub vz: f32,
6988 #[doc = "Differential pressure."]
6989 pub diff_pressure: f32,
6990 #[doc = "Estimated to true airspeed ratio."]
6991 pub EAS2TAS: f32,
6992 #[doc = "Airspeed ratio."]
6993 pub ratio: f32,
6994 #[doc = "EKF state x."]
6995 pub state_x: f32,
6996 #[doc = "EKF state y."]
6997 pub state_y: f32,
6998 #[doc = "EKF state z."]
6999 pub state_z: f32,
7000 #[doc = "EKF Pax."]
7001 pub Pax: f32,
7002 #[doc = "EKF Pby."]
7003 pub Pby: f32,
7004 #[doc = "EKF Pcz."]
7005 pub Pcz: f32,
7006}
7007impl AIRSPEED_AUTOCAL_DATA {
7008 pub const ENCODED_LEN: usize = 48usize;
7009 pub const DEFAULT: Self = Self {
7010 vx: 0.0_f32,
7011 vy: 0.0_f32,
7012 vz: 0.0_f32,
7013 diff_pressure: 0.0_f32,
7014 EAS2TAS: 0.0_f32,
7015 ratio: 0.0_f32,
7016 state_x: 0.0_f32,
7017 state_y: 0.0_f32,
7018 state_z: 0.0_f32,
7019 Pax: 0.0_f32,
7020 Pby: 0.0_f32,
7021 Pcz: 0.0_f32,
7022 };
7023 #[cfg(feature = "arbitrary")]
7024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7025 use arbitrary::{Arbitrary, Unstructured};
7026 let mut buf = [0u8; 1024];
7027 rng.fill_bytes(&mut buf);
7028 let mut unstructured = Unstructured::new(&buf);
7029 Self::arbitrary(&mut unstructured).unwrap_or_default()
7030 }
7031}
7032impl Default for AIRSPEED_AUTOCAL_DATA {
7033 fn default() -> Self {
7034 Self::DEFAULT.clone()
7035 }
7036}
7037impl MessageData for AIRSPEED_AUTOCAL_DATA {
7038 type Message = MavMessage;
7039 const ID: u32 = 174u32;
7040 const NAME: &'static str = "AIRSPEED_AUTOCAL";
7041 const EXTRA_CRC: u8 = 167u8;
7042 const ENCODED_LEN: usize = 48usize;
7043 fn deser(
7044 _version: MavlinkVersion,
7045 __input: &[u8],
7046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7047 let avail_len = __input.len();
7048 let mut payload_buf = [0; Self::ENCODED_LEN];
7049 let mut buf = if avail_len < Self::ENCODED_LEN {
7050 payload_buf[0..avail_len].copy_from_slice(__input);
7051 Bytes::new(&payload_buf)
7052 } else {
7053 Bytes::new(__input)
7054 };
7055 let mut __struct = Self::default();
7056 __struct.vx = buf.get_f32_le();
7057 __struct.vy = buf.get_f32_le();
7058 __struct.vz = buf.get_f32_le();
7059 __struct.diff_pressure = buf.get_f32_le();
7060 __struct.EAS2TAS = buf.get_f32_le();
7061 __struct.ratio = buf.get_f32_le();
7062 __struct.state_x = buf.get_f32_le();
7063 __struct.state_y = buf.get_f32_le();
7064 __struct.state_z = buf.get_f32_le();
7065 __struct.Pax = buf.get_f32_le();
7066 __struct.Pby = buf.get_f32_le();
7067 __struct.Pcz = buf.get_f32_le();
7068 Ok(__struct)
7069 }
7070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7071 let mut __tmp = BytesMut::new(bytes);
7072 #[allow(clippy::absurd_extreme_comparisons)]
7073 #[allow(unused_comparisons)]
7074 if __tmp.remaining() < Self::ENCODED_LEN {
7075 panic!(
7076 "buffer is too small (need {} bytes, but got {})",
7077 Self::ENCODED_LEN,
7078 __tmp.remaining(),
7079 )
7080 }
7081 __tmp.put_f32_le(self.vx);
7082 __tmp.put_f32_le(self.vy);
7083 __tmp.put_f32_le(self.vz);
7084 __tmp.put_f32_le(self.diff_pressure);
7085 __tmp.put_f32_le(self.EAS2TAS);
7086 __tmp.put_f32_le(self.ratio);
7087 __tmp.put_f32_le(self.state_x);
7088 __tmp.put_f32_le(self.state_y);
7089 __tmp.put_f32_le(self.state_z);
7090 __tmp.put_f32_le(self.Pax);
7091 __tmp.put_f32_le(self.Pby);
7092 __tmp.put_f32_le(self.Pcz);
7093 if matches!(version, MavlinkVersion::V2) {
7094 let len = __tmp.len();
7095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7096 } else {
7097 __tmp.len()
7098 }
7099 }
7100}
7101#[doc = "id: 301"]
7102#[doc = "The location and information of an AIS vessel."]
7103#[derive(Debug, Clone, PartialEq)]
7104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7106pub struct AIS_VESSEL_DATA {
7107 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
7108 pub MMSI: u32,
7109 #[doc = "Latitude"]
7110 pub lat: i32,
7111 #[doc = "Longitude"]
7112 pub lon: i32,
7113 #[doc = "Course over ground"]
7114 pub COG: u16,
7115 #[doc = "True heading"]
7116 pub heading: u16,
7117 #[doc = "Speed over ground"]
7118 pub velocity: u16,
7119 #[doc = "Distance from lat/lon location to bow"]
7120 pub dimension_bow: u16,
7121 #[doc = "Distance from lat/lon location to stern"]
7122 pub dimension_stern: u16,
7123 #[doc = "Time since last communication in seconds"]
7124 pub tslc: u16,
7125 #[doc = "Bitmask to indicate various statuses including valid data fields"]
7126 pub flags: AisFlags,
7127 #[doc = "Turn rate"]
7128 pub turn_rate: i8,
7129 #[doc = "Navigational status"]
7130 pub navigational_status: AisNavStatus,
7131 #[doc = "Type of vessels"]
7132 pub mavtype: AisType,
7133 #[doc = "Distance from lat/lon location to port side"]
7134 pub dimension_port: u8,
7135 #[doc = "Distance from lat/lon location to starboard side"]
7136 pub dimension_starboard: u8,
7137 #[doc = "The vessel callsign"]
7138 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7139 pub callsign: [u8; 7],
7140 #[doc = "The vessel name"]
7141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7142 pub name: [u8; 20],
7143}
7144impl AIS_VESSEL_DATA {
7145 pub const ENCODED_LEN: usize = 58usize;
7146 pub const DEFAULT: Self = Self {
7147 MMSI: 0_u32,
7148 lat: 0_i32,
7149 lon: 0_i32,
7150 COG: 0_u16,
7151 heading: 0_u16,
7152 velocity: 0_u16,
7153 dimension_bow: 0_u16,
7154 dimension_stern: 0_u16,
7155 tslc: 0_u16,
7156 flags: AisFlags::DEFAULT,
7157 turn_rate: 0_i8,
7158 navigational_status: AisNavStatus::DEFAULT,
7159 mavtype: AisType::DEFAULT,
7160 dimension_port: 0_u8,
7161 dimension_starboard: 0_u8,
7162 callsign: [0_u8; 7usize],
7163 name: [0_u8; 20usize],
7164 };
7165 #[cfg(feature = "arbitrary")]
7166 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7167 use arbitrary::{Arbitrary, Unstructured};
7168 let mut buf = [0u8; 1024];
7169 rng.fill_bytes(&mut buf);
7170 let mut unstructured = Unstructured::new(&buf);
7171 Self::arbitrary(&mut unstructured).unwrap_or_default()
7172 }
7173}
7174impl Default for AIS_VESSEL_DATA {
7175 fn default() -> Self {
7176 Self::DEFAULT.clone()
7177 }
7178}
7179impl MessageData for AIS_VESSEL_DATA {
7180 type Message = MavMessage;
7181 const ID: u32 = 301u32;
7182 const NAME: &'static str = "AIS_VESSEL";
7183 const EXTRA_CRC: u8 = 243u8;
7184 const ENCODED_LEN: usize = 58usize;
7185 fn deser(
7186 _version: MavlinkVersion,
7187 __input: &[u8],
7188 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7189 let avail_len = __input.len();
7190 let mut payload_buf = [0; Self::ENCODED_LEN];
7191 let mut buf = if avail_len < Self::ENCODED_LEN {
7192 payload_buf[0..avail_len].copy_from_slice(__input);
7193 Bytes::new(&payload_buf)
7194 } else {
7195 Bytes::new(__input)
7196 };
7197 let mut __struct = Self::default();
7198 __struct.MMSI = buf.get_u32_le();
7199 __struct.lat = buf.get_i32_le();
7200 __struct.lon = buf.get_i32_le();
7201 __struct.COG = buf.get_u16_le();
7202 __struct.heading = buf.get_u16_le();
7203 __struct.velocity = buf.get_u16_le();
7204 __struct.dimension_bow = buf.get_u16_le();
7205 __struct.dimension_stern = buf.get_u16_le();
7206 __struct.tslc = buf.get_u16_le();
7207 let tmp = buf.get_u16_le();
7208 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
7209 ::mavlink_core::error::ParserError::InvalidFlag {
7210 flag_type: "AisFlags",
7211 value: tmp as u32,
7212 },
7213 )?;
7214 __struct.turn_rate = buf.get_i8();
7215 let tmp = buf.get_u8();
7216 __struct.navigational_status =
7217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7218 enum_type: "AisNavStatus",
7219 value: tmp as u32,
7220 })?;
7221 let tmp = buf.get_u8();
7222 __struct.mavtype =
7223 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7224 enum_type: "AisType",
7225 value: tmp as u32,
7226 })?;
7227 __struct.dimension_port = buf.get_u8();
7228 __struct.dimension_starboard = buf.get_u8();
7229 for v in &mut __struct.callsign {
7230 let val = buf.get_u8();
7231 *v = val;
7232 }
7233 for v in &mut __struct.name {
7234 let val = buf.get_u8();
7235 *v = val;
7236 }
7237 Ok(__struct)
7238 }
7239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7240 let mut __tmp = BytesMut::new(bytes);
7241 #[allow(clippy::absurd_extreme_comparisons)]
7242 #[allow(unused_comparisons)]
7243 if __tmp.remaining() < Self::ENCODED_LEN {
7244 panic!(
7245 "buffer is too small (need {} bytes, but got {})",
7246 Self::ENCODED_LEN,
7247 __tmp.remaining(),
7248 )
7249 }
7250 __tmp.put_u32_le(self.MMSI);
7251 __tmp.put_i32_le(self.lat);
7252 __tmp.put_i32_le(self.lon);
7253 __tmp.put_u16_le(self.COG);
7254 __tmp.put_u16_le(self.heading);
7255 __tmp.put_u16_le(self.velocity);
7256 __tmp.put_u16_le(self.dimension_bow);
7257 __tmp.put_u16_le(self.dimension_stern);
7258 __tmp.put_u16_le(self.tslc);
7259 __tmp.put_u16_le(self.flags.bits());
7260 __tmp.put_i8(self.turn_rate);
7261 __tmp.put_u8(self.navigational_status as u8);
7262 __tmp.put_u8(self.mavtype as u8);
7263 __tmp.put_u8(self.dimension_port);
7264 __tmp.put_u8(self.dimension_starboard);
7265 for val in &self.callsign {
7266 __tmp.put_u8(*val);
7267 }
7268 for val in &self.name {
7269 __tmp.put_u8(*val);
7270 }
7271 if matches!(version, MavlinkVersion::V2) {
7272 let len = __tmp.len();
7273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7274 } else {
7275 __tmp.len()
7276 }
7277 }
7278}
7279#[doc = "id: 141"]
7280#[doc = "The current system altitude."]
7281#[derive(Debug, Clone, PartialEq)]
7282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7284pub struct ALTITUDE_DATA {
7285 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7286 pub time_usec: u64,
7287 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
7288 pub altitude_monotonic: f32,
7289 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
7290 pub altitude_amsl: f32,
7291 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
7292 pub altitude_local: f32,
7293 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
7294 pub altitude_relative: f32,
7295 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
7296 pub altitude_terrain: f32,
7297 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
7298 pub bottom_clearance: f32,
7299}
7300impl ALTITUDE_DATA {
7301 pub const ENCODED_LEN: usize = 32usize;
7302 pub const DEFAULT: Self = Self {
7303 time_usec: 0_u64,
7304 altitude_monotonic: 0.0_f32,
7305 altitude_amsl: 0.0_f32,
7306 altitude_local: 0.0_f32,
7307 altitude_relative: 0.0_f32,
7308 altitude_terrain: 0.0_f32,
7309 bottom_clearance: 0.0_f32,
7310 };
7311 #[cfg(feature = "arbitrary")]
7312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7313 use arbitrary::{Arbitrary, Unstructured};
7314 let mut buf = [0u8; 1024];
7315 rng.fill_bytes(&mut buf);
7316 let mut unstructured = Unstructured::new(&buf);
7317 Self::arbitrary(&mut unstructured).unwrap_or_default()
7318 }
7319}
7320impl Default for ALTITUDE_DATA {
7321 fn default() -> Self {
7322 Self::DEFAULT.clone()
7323 }
7324}
7325impl MessageData for ALTITUDE_DATA {
7326 type Message = MavMessage;
7327 const ID: u32 = 141u32;
7328 const NAME: &'static str = "ALTITUDE";
7329 const EXTRA_CRC: u8 = 47u8;
7330 const ENCODED_LEN: usize = 32usize;
7331 fn deser(
7332 _version: MavlinkVersion,
7333 __input: &[u8],
7334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7335 let avail_len = __input.len();
7336 let mut payload_buf = [0; Self::ENCODED_LEN];
7337 let mut buf = if avail_len < Self::ENCODED_LEN {
7338 payload_buf[0..avail_len].copy_from_slice(__input);
7339 Bytes::new(&payload_buf)
7340 } else {
7341 Bytes::new(__input)
7342 };
7343 let mut __struct = Self::default();
7344 __struct.time_usec = buf.get_u64_le();
7345 __struct.altitude_monotonic = buf.get_f32_le();
7346 __struct.altitude_amsl = buf.get_f32_le();
7347 __struct.altitude_local = buf.get_f32_le();
7348 __struct.altitude_relative = buf.get_f32_le();
7349 __struct.altitude_terrain = buf.get_f32_le();
7350 __struct.bottom_clearance = buf.get_f32_le();
7351 Ok(__struct)
7352 }
7353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7354 let mut __tmp = BytesMut::new(bytes);
7355 #[allow(clippy::absurd_extreme_comparisons)]
7356 #[allow(unused_comparisons)]
7357 if __tmp.remaining() < Self::ENCODED_LEN {
7358 panic!(
7359 "buffer is too small (need {} bytes, but got {})",
7360 Self::ENCODED_LEN,
7361 __tmp.remaining(),
7362 )
7363 }
7364 __tmp.put_u64_le(self.time_usec);
7365 __tmp.put_f32_le(self.altitude_monotonic);
7366 __tmp.put_f32_le(self.altitude_amsl);
7367 __tmp.put_f32_le(self.altitude_local);
7368 __tmp.put_f32_le(self.altitude_relative);
7369 __tmp.put_f32_le(self.altitude_terrain);
7370 __tmp.put_f32_le(self.bottom_clearance);
7371 if matches!(version, MavlinkVersion::V2) {
7372 let len = __tmp.len();
7373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7374 } else {
7375 __tmp.len()
7376 }
7377 }
7378}
7379#[doc = "id: 11020"]
7380#[doc = "Angle of Attack and Side Slip Angle."]
7381#[derive(Debug, Clone, PartialEq)]
7382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7384pub struct AOA_SSA_DATA {
7385 #[doc = "Timestamp (since boot or Unix epoch)."]
7386 pub time_usec: u64,
7387 #[doc = "Angle of Attack."]
7388 pub AOA: f32,
7389 #[doc = "Side Slip Angle."]
7390 pub SSA: f32,
7391}
7392impl AOA_SSA_DATA {
7393 pub const ENCODED_LEN: usize = 16usize;
7394 pub const DEFAULT: Self = Self {
7395 time_usec: 0_u64,
7396 AOA: 0.0_f32,
7397 SSA: 0.0_f32,
7398 };
7399 #[cfg(feature = "arbitrary")]
7400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7401 use arbitrary::{Arbitrary, Unstructured};
7402 let mut buf = [0u8; 1024];
7403 rng.fill_bytes(&mut buf);
7404 let mut unstructured = Unstructured::new(&buf);
7405 Self::arbitrary(&mut unstructured).unwrap_or_default()
7406 }
7407}
7408impl Default for AOA_SSA_DATA {
7409 fn default() -> Self {
7410 Self::DEFAULT.clone()
7411 }
7412}
7413impl MessageData for AOA_SSA_DATA {
7414 type Message = MavMessage;
7415 const ID: u32 = 11020u32;
7416 const NAME: &'static str = "AOA_SSA";
7417 const EXTRA_CRC: u8 = 205u8;
7418 const ENCODED_LEN: usize = 16usize;
7419 fn deser(
7420 _version: MavlinkVersion,
7421 __input: &[u8],
7422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7423 let avail_len = __input.len();
7424 let mut payload_buf = [0; Self::ENCODED_LEN];
7425 let mut buf = if avail_len < Self::ENCODED_LEN {
7426 payload_buf[0..avail_len].copy_from_slice(__input);
7427 Bytes::new(&payload_buf)
7428 } else {
7429 Bytes::new(__input)
7430 };
7431 let mut __struct = Self::default();
7432 __struct.time_usec = buf.get_u64_le();
7433 __struct.AOA = buf.get_f32_le();
7434 __struct.SSA = buf.get_f32_le();
7435 Ok(__struct)
7436 }
7437 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7438 let mut __tmp = BytesMut::new(bytes);
7439 #[allow(clippy::absurd_extreme_comparisons)]
7440 #[allow(unused_comparisons)]
7441 if __tmp.remaining() < Self::ENCODED_LEN {
7442 panic!(
7443 "buffer is too small (need {} bytes, but got {})",
7444 Self::ENCODED_LEN,
7445 __tmp.remaining(),
7446 )
7447 }
7448 __tmp.put_u64_le(self.time_usec);
7449 __tmp.put_f32_le(self.AOA);
7450 __tmp.put_f32_le(self.SSA);
7451 if matches!(version, MavlinkVersion::V2) {
7452 let len = __tmp.len();
7453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7454 } else {
7455 __tmp.len()
7456 }
7457 }
7458}
7459#[doc = "id: 153"]
7460#[doc = "Raw ADC output."]
7461#[derive(Debug, Clone, PartialEq)]
7462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7464pub struct AP_ADC_DATA {
7465 #[doc = "ADC output 1."]
7466 pub adc1: u16,
7467 #[doc = "ADC output 2."]
7468 pub adc2: u16,
7469 #[doc = "ADC output 3."]
7470 pub adc3: u16,
7471 #[doc = "ADC output 4."]
7472 pub adc4: u16,
7473 #[doc = "ADC output 5."]
7474 pub adc5: u16,
7475 #[doc = "ADC output 6."]
7476 pub adc6: u16,
7477}
7478impl AP_ADC_DATA {
7479 pub const ENCODED_LEN: usize = 12usize;
7480 pub const DEFAULT: Self = Self {
7481 adc1: 0_u16,
7482 adc2: 0_u16,
7483 adc3: 0_u16,
7484 adc4: 0_u16,
7485 adc5: 0_u16,
7486 adc6: 0_u16,
7487 };
7488 #[cfg(feature = "arbitrary")]
7489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7490 use arbitrary::{Arbitrary, Unstructured};
7491 let mut buf = [0u8; 1024];
7492 rng.fill_bytes(&mut buf);
7493 let mut unstructured = Unstructured::new(&buf);
7494 Self::arbitrary(&mut unstructured).unwrap_or_default()
7495 }
7496}
7497impl Default for AP_ADC_DATA {
7498 fn default() -> Self {
7499 Self::DEFAULT.clone()
7500 }
7501}
7502impl MessageData for AP_ADC_DATA {
7503 type Message = MavMessage;
7504 const ID: u32 = 153u32;
7505 const NAME: &'static str = "AP_ADC";
7506 const EXTRA_CRC: u8 = 188u8;
7507 const ENCODED_LEN: usize = 12usize;
7508 fn deser(
7509 _version: MavlinkVersion,
7510 __input: &[u8],
7511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7512 let avail_len = __input.len();
7513 let mut payload_buf = [0; Self::ENCODED_LEN];
7514 let mut buf = if avail_len < Self::ENCODED_LEN {
7515 payload_buf[0..avail_len].copy_from_slice(__input);
7516 Bytes::new(&payload_buf)
7517 } else {
7518 Bytes::new(__input)
7519 };
7520 let mut __struct = Self::default();
7521 __struct.adc1 = buf.get_u16_le();
7522 __struct.adc2 = buf.get_u16_le();
7523 __struct.adc3 = buf.get_u16_le();
7524 __struct.adc4 = buf.get_u16_le();
7525 __struct.adc5 = buf.get_u16_le();
7526 __struct.adc6 = buf.get_u16_le();
7527 Ok(__struct)
7528 }
7529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7530 let mut __tmp = BytesMut::new(bytes);
7531 #[allow(clippy::absurd_extreme_comparisons)]
7532 #[allow(unused_comparisons)]
7533 if __tmp.remaining() < Self::ENCODED_LEN {
7534 panic!(
7535 "buffer is too small (need {} bytes, but got {})",
7536 Self::ENCODED_LEN,
7537 __tmp.remaining(),
7538 )
7539 }
7540 __tmp.put_u16_le(self.adc1);
7541 __tmp.put_u16_le(self.adc2);
7542 __tmp.put_u16_le(self.adc3);
7543 __tmp.put_u16_le(self.adc4);
7544 __tmp.put_u16_le(self.adc5);
7545 __tmp.put_u16_le(self.adc6);
7546 if matches!(version, MavlinkVersion::V2) {
7547 let len = __tmp.len();
7548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7549 } else {
7550 __tmp.len()
7551 }
7552 }
7553}
7554#[doc = "id: 30"]
7555#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
7556#[derive(Debug, Clone, PartialEq)]
7557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7559pub struct ATTITUDE_DATA {
7560 #[doc = "Timestamp (time since system boot)."]
7561 pub time_boot_ms: u32,
7562 #[doc = "Roll angle (-pi..+pi)"]
7563 pub roll: f32,
7564 #[doc = "Pitch angle (-pi..+pi)"]
7565 pub pitch: f32,
7566 #[doc = "Yaw angle (-pi..+pi)"]
7567 pub yaw: f32,
7568 #[doc = "Roll angular speed"]
7569 pub rollspeed: f32,
7570 #[doc = "Pitch angular speed"]
7571 pub pitchspeed: f32,
7572 #[doc = "Yaw angular speed"]
7573 pub yawspeed: f32,
7574}
7575impl ATTITUDE_DATA {
7576 pub const ENCODED_LEN: usize = 28usize;
7577 pub const DEFAULT: Self = Self {
7578 time_boot_ms: 0_u32,
7579 roll: 0.0_f32,
7580 pitch: 0.0_f32,
7581 yaw: 0.0_f32,
7582 rollspeed: 0.0_f32,
7583 pitchspeed: 0.0_f32,
7584 yawspeed: 0.0_f32,
7585 };
7586 #[cfg(feature = "arbitrary")]
7587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7588 use arbitrary::{Arbitrary, Unstructured};
7589 let mut buf = [0u8; 1024];
7590 rng.fill_bytes(&mut buf);
7591 let mut unstructured = Unstructured::new(&buf);
7592 Self::arbitrary(&mut unstructured).unwrap_or_default()
7593 }
7594}
7595impl Default for ATTITUDE_DATA {
7596 fn default() -> Self {
7597 Self::DEFAULT.clone()
7598 }
7599}
7600impl MessageData for ATTITUDE_DATA {
7601 type Message = MavMessage;
7602 const ID: u32 = 30u32;
7603 const NAME: &'static str = "ATTITUDE";
7604 const EXTRA_CRC: u8 = 39u8;
7605 const ENCODED_LEN: usize = 28usize;
7606 fn deser(
7607 _version: MavlinkVersion,
7608 __input: &[u8],
7609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7610 let avail_len = __input.len();
7611 let mut payload_buf = [0; Self::ENCODED_LEN];
7612 let mut buf = if avail_len < Self::ENCODED_LEN {
7613 payload_buf[0..avail_len].copy_from_slice(__input);
7614 Bytes::new(&payload_buf)
7615 } else {
7616 Bytes::new(__input)
7617 };
7618 let mut __struct = Self::default();
7619 __struct.time_boot_ms = buf.get_u32_le();
7620 __struct.roll = buf.get_f32_le();
7621 __struct.pitch = buf.get_f32_le();
7622 __struct.yaw = buf.get_f32_le();
7623 __struct.rollspeed = buf.get_f32_le();
7624 __struct.pitchspeed = buf.get_f32_le();
7625 __struct.yawspeed = buf.get_f32_le();
7626 Ok(__struct)
7627 }
7628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7629 let mut __tmp = BytesMut::new(bytes);
7630 #[allow(clippy::absurd_extreme_comparisons)]
7631 #[allow(unused_comparisons)]
7632 if __tmp.remaining() < Self::ENCODED_LEN {
7633 panic!(
7634 "buffer is too small (need {} bytes, but got {})",
7635 Self::ENCODED_LEN,
7636 __tmp.remaining(),
7637 )
7638 }
7639 __tmp.put_u32_le(self.time_boot_ms);
7640 __tmp.put_f32_le(self.roll);
7641 __tmp.put_f32_le(self.pitch);
7642 __tmp.put_f32_le(self.yaw);
7643 __tmp.put_f32_le(self.rollspeed);
7644 __tmp.put_f32_le(self.pitchspeed);
7645 __tmp.put_f32_le(self.yawspeed);
7646 if matches!(version, MavlinkVersion::V2) {
7647 let len = __tmp.len();
7648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7649 } else {
7650 __tmp.len()
7651 }
7652 }
7653}
7654#[doc = "id: 31"]
7655#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
7656#[derive(Debug, Clone, PartialEq)]
7657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7659pub struct ATTITUDE_QUATERNION_DATA {
7660 #[doc = "Timestamp (time since system boot)."]
7661 pub time_boot_ms: u32,
7662 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
7663 pub q1: f32,
7664 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
7665 pub q2: f32,
7666 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
7667 pub q3: f32,
7668 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
7669 pub q4: f32,
7670 #[doc = "Roll angular speed"]
7671 pub rollspeed: f32,
7672 #[doc = "Pitch angular speed"]
7673 pub pitchspeed: f32,
7674 #[doc = "Yaw angular speed"]
7675 pub yawspeed: f32,
7676 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
7677 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7679 pub repr_offset_q: [f32; 4],
7680}
7681impl ATTITUDE_QUATERNION_DATA {
7682 pub const ENCODED_LEN: usize = 48usize;
7683 pub const DEFAULT: Self = Self {
7684 time_boot_ms: 0_u32,
7685 q1: 0.0_f32,
7686 q2: 0.0_f32,
7687 q3: 0.0_f32,
7688 q4: 0.0_f32,
7689 rollspeed: 0.0_f32,
7690 pitchspeed: 0.0_f32,
7691 yawspeed: 0.0_f32,
7692 repr_offset_q: [0.0_f32; 4usize],
7693 };
7694 #[cfg(feature = "arbitrary")]
7695 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7696 use arbitrary::{Arbitrary, Unstructured};
7697 let mut buf = [0u8; 1024];
7698 rng.fill_bytes(&mut buf);
7699 let mut unstructured = Unstructured::new(&buf);
7700 Self::arbitrary(&mut unstructured).unwrap_or_default()
7701 }
7702}
7703impl Default for ATTITUDE_QUATERNION_DATA {
7704 fn default() -> Self {
7705 Self::DEFAULT.clone()
7706 }
7707}
7708impl MessageData for ATTITUDE_QUATERNION_DATA {
7709 type Message = MavMessage;
7710 const ID: u32 = 31u32;
7711 const NAME: &'static str = "ATTITUDE_QUATERNION";
7712 const EXTRA_CRC: u8 = 246u8;
7713 const ENCODED_LEN: usize = 48usize;
7714 fn deser(
7715 _version: MavlinkVersion,
7716 __input: &[u8],
7717 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7718 let avail_len = __input.len();
7719 let mut payload_buf = [0; Self::ENCODED_LEN];
7720 let mut buf = if avail_len < Self::ENCODED_LEN {
7721 payload_buf[0..avail_len].copy_from_slice(__input);
7722 Bytes::new(&payload_buf)
7723 } else {
7724 Bytes::new(__input)
7725 };
7726 let mut __struct = Self::default();
7727 __struct.time_boot_ms = buf.get_u32_le();
7728 __struct.q1 = buf.get_f32_le();
7729 __struct.q2 = buf.get_f32_le();
7730 __struct.q3 = buf.get_f32_le();
7731 __struct.q4 = buf.get_f32_le();
7732 __struct.rollspeed = buf.get_f32_le();
7733 __struct.pitchspeed = buf.get_f32_le();
7734 __struct.yawspeed = buf.get_f32_le();
7735 for v in &mut __struct.repr_offset_q {
7736 let val = buf.get_f32_le();
7737 *v = val;
7738 }
7739 Ok(__struct)
7740 }
7741 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7742 let mut __tmp = BytesMut::new(bytes);
7743 #[allow(clippy::absurd_extreme_comparisons)]
7744 #[allow(unused_comparisons)]
7745 if __tmp.remaining() < Self::ENCODED_LEN {
7746 panic!(
7747 "buffer is too small (need {} bytes, but got {})",
7748 Self::ENCODED_LEN,
7749 __tmp.remaining(),
7750 )
7751 }
7752 __tmp.put_u32_le(self.time_boot_ms);
7753 __tmp.put_f32_le(self.q1);
7754 __tmp.put_f32_le(self.q2);
7755 __tmp.put_f32_le(self.q3);
7756 __tmp.put_f32_le(self.q4);
7757 __tmp.put_f32_le(self.rollspeed);
7758 __tmp.put_f32_le(self.pitchspeed);
7759 __tmp.put_f32_le(self.yawspeed);
7760 for val in &self.repr_offset_q {
7761 __tmp.put_f32_le(*val);
7762 }
7763 if matches!(version, MavlinkVersion::V2) {
7764 let len = __tmp.len();
7765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7766 } else {
7767 __tmp.len()
7768 }
7769 }
7770}
7771#[doc = "id: 61"]
7772#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
7773#[derive(Debug, Clone, PartialEq)]
7774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7776pub struct ATTITUDE_QUATERNION_COV_DATA {
7777 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7778 pub time_usec: u64,
7779 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
7780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7781 pub q: [f32; 4],
7782 #[doc = "Roll angular speed"]
7783 pub rollspeed: f32,
7784 #[doc = "Pitch angular speed"]
7785 pub pitchspeed: f32,
7786 #[doc = "Yaw angular speed"]
7787 pub yawspeed: f32,
7788 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
7789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7790 pub covariance: [f32; 9],
7791}
7792impl ATTITUDE_QUATERNION_COV_DATA {
7793 pub const ENCODED_LEN: usize = 72usize;
7794 pub const DEFAULT: Self = Self {
7795 time_usec: 0_u64,
7796 q: [0.0_f32; 4usize],
7797 rollspeed: 0.0_f32,
7798 pitchspeed: 0.0_f32,
7799 yawspeed: 0.0_f32,
7800 covariance: [0.0_f32; 9usize],
7801 };
7802 #[cfg(feature = "arbitrary")]
7803 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7804 use arbitrary::{Arbitrary, Unstructured};
7805 let mut buf = [0u8; 1024];
7806 rng.fill_bytes(&mut buf);
7807 let mut unstructured = Unstructured::new(&buf);
7808 Self::arbitrary(&mut unstructured).unwrap_or_default()
7809 }
7810}
7811impl Default for ATTITUDE_QUATERNION_COV_DATA {
7812 fn default() -> Self {
7813 Self::DEFAULT.clone()
7814 }
7815}
7816impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
7817 type Message = MavMessage;
7818 const ID: u32 = 61u32;
7819 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
7820 const EXTRA_CRC: u8 = 167u8;
7821 const ENCODED_LEN: usize = 72usize;
7822 fn deser(
7823 _version: MavlinkVersion,
7824 __input: &[u8],
7825 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7826 let avail_len = __input.len();
7827 let mut payload_buf = [0; Self::ENCODED_LEN];
7828 let mut buf = if avail_len < Self::ENCODED_LEN {
7829 payload_buf[0..avail_len].copy_from_slice(__input);
7830 Bytes::new(&payload_buf)
7831 } else {
7832 Bytes::new(__input)
7833 };
7834 let mut __struct = Self::default();
7835 __struct.time_usec = buf.get_u64_le();
7836 for v in &mut __struct.q {
7837 let val = buf.get_f32_le();
7838 *v = val;
7839 }
7840 __struct.rollspeed = buf.get_f32_le();
7841 __struct.pitchspeed = buf.get_f32_le();
7842 __struct.yawspeed = buf.get_f32_le();
7843 for v in &mut __struct.covariance {
7844 let val = buf.get_f32_le();
7845 *v = val;
7846 }
7847 Ok(__struct)
7848 }
7849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7850 let mut __tmp = BytesMut::new(bytes);
7851 #[allow(clippy::absurd_extreme_comparisons)]
7852 #[allow(unused_comparisons)]
7853 if __tmp.remaining() < Self::ENCODED_LEN {
7854 panic!(
7855 "buffer is too small (need {} bytes, but got {})",
7856 Self::ENCODED_LEN,
7857 __tmp.remaining(),
7858 )
7859 }
7860 __tmp.put_u64_le(self.time_usec);
7861 for val in &self.q {
7862 __tmp.put_f32_le(*val);
7863 }
7864 __tmp.put_f32_le(self.rollspeed);
7865 __tmp.put_f32_le(self.pitchspeed);
7866 __tmp.put_f32_le(self.yawspeed);
7867 for val in &self.covariance {
7868 __tmp.put_f32_le(*val);
7869 }
7870 if matches!(version, MavlinkVersion::V2) {
7871 let len = __tmp.len();
7872 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7873 } else {
7874 __tmp.len()
7875 }
7876 }
7877}
7878#[doc = "id: 83"]
7879#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
7880#[derive(Debug, Clone, PartialEq)]
7881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7883pub struct ATTITUDE_TARGET_DATA {
7884 #[doc = "Timestamp (time since system boot)."]
7885 pub time_boot_ms: u32,
7886 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7887 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7888 pub q: [f32; 4],
7889 #[doc = "Body roll rate"]
7890 pub body_roll_rate: f32,
7891 #[doc = "Body pitch rate"]
7892 pub body_pitch_rate: f32,
7893 #[doc = "Body yaw rate"]
7894 pub body_yaw_rate: f32,
7895 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
7896 pub thrust: f32,
7897 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
7898 pub type_mask: AttitudeTargetTypemask,
7899}
7900impl ATTITUDE_TARGET_DATA {
7901 pub const ENCODED_LEN: usize = 37usize;
7902 pub const DEFAULT: Self = Self {
7903 time_boot_ms: 0_u32,
7904 q: [0.0_f32; 4usize],
7905 body_roll_rate: 0.0_f32,
7906 body_pitch_rate: 0.0_f32,
7907 body_yaw_rate: 0.0_f32,
7908 thrust: 0.0_f32,
7909 type_mask: AttitudeTargetTypemask::DEFAULT,
7910 };
7911 #[cfg(feature = "arbitrary")]
7912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7913 use arbitrary::{Arbitrary, Unstructured};
7914 let mut buf = [0u8; 1024];
7915 rng.fill_bytes(&mut buf);
7916 let mut unstructured = Unstructured::new(&buf);
7917 Self::arbitrary(&mut unstructured).unwrap_or_default()
7918 }
7919}
7920impl Default for ATTITUDE_TARGET_DATA {
7921 fn default() -> Self {
7922 Self::DEFAULT.clone()
7923 }
7924}
7925impl MessageData for ATTITUDE_TARGET_DATA {
7926 type Message = MavMessage;
7927 const ID: u32 = 83u32;
7928 const NAME: &'static str = "ATTITUDE_TARGET";
7929 const EXTRA_CRC: u8 = 22u8;
7930 const ENCODED_LEN: usize = 37usize;
7931 fn deser(
7932 _version: MavlinkVersion,
7933 __input: &[u8],
7934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7935 let avail_len = __input.len();
7936 let mut payload_buf = [0; Self::ENCODED_LEN];
7937 let mut buf = if avail_len < Self::ENCODED_LEN {
7938 payload_buf[0..avail_len].copy_from_slice(__input);
7939 Bytes::new(&payload_buf)
7940 } else {
7941 Bytes::new(__input)
7942 };
7943 let mut __struct = Self::default();
7944 __struct.time_boot_ms = buf.get_u32_le();
7945 for v in &mut __struct.q {
7946 let val = buf.get_f32_le();
7947 *v = val;
7948 }
7949 __struct.body_roll_rate = buf.get_f32_le();
7950 __struct.body_pitch_rate = buf.get_f32_le();
7951 __struct.body_yaw_rate = buf.get_f32_le();
7952 __struct.thrust = buf.get_f32_le();
7953 let tmp = buf.get_u8();
7954 __struct.type_mask = AttitudeTargetTypemask::from_bits(
7955 tmp & AttitudeTargetTypemask::all().bits(),
7956 )
7957 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7958 flag_type: "AttitudeTargetTypemask",
7959 value: tmp as u32,
7960 })?;
7961 Ok(__struct)
7962 }
7963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7964 let mut __tmp = BytesMut::new(bytes);
7965 #[allow(clippy::absurd_extreme_comparisons)]
7966 #[allow(unused_comparisons)]
7967 if __tmp.remaining() < Self::ENCODED_LEN {
7968 panic!(
7969 "buffer is too small (need {} bytes, but got {})",
7970 Self::ENCODED_LEN,
7971 __tmp.remaining(),
7972 )
7973 }
7974 __tmp.put_u32_le(self.time_boot_ms);
7975 for val in &self.q {
7976 __tmp.put_f32_le(*val);
7977 }
7978 __tmp.put_f32_le(self.body_roll_rate);
7979 __tmp.put_f32_le(self.body_pitch_rate);
7980 __tmp.put_f32_le(self.body_yaw_rate);
7981 __tmp.put_f32_le(self.thrust);
7982 __tmp.put_u8(self.type_mask.bits());
7983 if matches!(version, MavlinkVersion::V2) {
7984 let len = __tmp.len();
7985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7986 } else {
7987 __tmp.len()
7988 }
7989 }
7990}
7991#[doc = "id: 138"]
7992#[doc = "Motion capture attitude and position."]
7993#[derive(Debug, Clone, PartialEq)]
7994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7996pub struct ATT_POS_MOCAP_DATA {
7997 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7998 pub time_usec: u64,
7999 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
8000 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8001 pub q: [f32; 4],
8002 #[doc = "X position (NED)"]
8003 pub x: f32,
8004 #[doc = "Y position (NED)"]
8005 pub y: f32,
8006 #[doc = "Z position (NED)"]
8007 pub z: f32,
8008 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
8009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8011 pub covariance: [f32; 21],
8012}
8013impl ATT_POS_MOCAP_DATA {
8014 pub const ENCODED_LEN: usize = 120usize;
8015 pub const DEFAULT: Self = Self {
8016 time_usec: 0_u64,
8017 q: [0.0_f32; 4usize],
8018 x: 0.0_f32,
8019 y: 0.0_f32,
8020 z: 0.0_f32,
8021 covariance: [0.0_f32; 21usize],
8022 };
8023 #[cfg(feature = "arbitrary")]
8024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8025 use arbitrary::{Arbitrary, Unstructured};
8026 let mut buf = [0u8; 1024];
8027 rng.fill_bytes(&mut buf);
8028 let mut unstructured = Unstructured::new(&buf);
8029 Self::arbitrary(&mut unstructured).unwrap_or_default()
8030 }
8031}
8032impl Default for ATT_POS_MOCAP_DATA {
8033 fn default() -> Self {
8034 Self::DEFAULT.clone()
8035 }
8036}
8037impl MessageData for ATT_POS_MOCAP_DATA {
8038 type Message = MavMessage;
8039 const ID: u32 = 138u32;
8040 const NAME: &'static str = "ATT_POS_MOCAP";
8041 const EXTRA_CRC: u8 = 109u8;
8042 const ENCODED_LEN: usize = 120usize;
8043 fn deser(
8044 _version: MavlinkVersion,
8045 __input: &[u8],
8046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8047 let avail_len = __input.len();
8048 let mut payload_buf = [0; Self::ENCODED_LEN];
8049 let mut buf = if avail_len < Self::ENCODED_LEN {
8050 payload_buf[0..avail_len].copy_from_slice(__input);
8051 Bytes::new(&payload_buf)
8052 } else {
8053 Bytes::new(__input)
8054 };
8055 let mut __struct = Self::default();
8056 __struct.time_usec = buf.get_u64_le();
8057 for v in &mut __struct.q {
8058 let val = buf.get_f32_le();
8059 *v = val;
8060 }
8061 __struct.x = buf.get_f32_le();
8062 __struct.y = buf.get_f32_le();
8063 __struct.z = buf.get_f32_le();
8064 for v in &mut __struct.covariance {
8065 let val = buf.get_f32_le();
8066 *v = val;
8067 }
8068 Ok(__struct)
8069 }
8070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8071 let mut __tmp = BytesMut::new(bytes);
8072 #[allow(clippy::absurd_extreme_comparisons)]
8073 #[allow(unused_comparisons)]
8074 if __tmp.remaining() < Self::ENCODED_LEN {
8075 panic!(
8076 "buffer is too small (need {} bytes, but got {})",
8077 Self::ENCODED_LEN,
8078 __tmp.remaining(),
8079 )
8080 }
8081 __tmp.put_u64_le(self.time_usec);
8082 for val in &self.q {
8083 __tmp.put_f32_le(*val);
8084 }
8085 __tmp.put_f32_le(self.x);
8086 __tmp.put_f32_le(self.y);
8087 __tmp.put_f32_le(self.z);
8088 for val in &self.covariance {
8089 __tmp.put_f32_le(*val);
8090 }
8091 if matches!(version, MavlinkVersion::V2) {
8092 let len = __tmp.len();
8093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8094 } else {
8095 __tmp.len()
8096 }
8097 }
8098}
8099#[doc = "id: 7"]
8100#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
8101#[derive(Debug, Clone, PartialEq)]
8102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8103#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8104pub struct AUTH_KEY_DATA {
8105 #[doc = "key"]
8106 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8107 pub key: [u8; 32],
8108}
8109impl AUTH_KEY_DATA {
8110 pub const ENCODED_LEN: usize = 32usize;
8111 pub const DEFAULT: Self = Self {
8112 key: [0_u8; 32usize],
8113 };
8114 #[cfg(feature = "arbitrary")]
8115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8116 use arbitrary::{Arbitrary, Unstructured};
8117 let mut buf = [0u8; 1024];
8118 rng.fill_bytes(&mut buf);
8119 let mut unstructured = Unstructured::new(&buf);
8120 Self::arbitrary(&mut unstructured).unwrap_or_default()
8121 }
8122}
8123impl Default for AUTH_KEY_DATA {
8124 fn default() -> Self {
8125 Self::DEFAULT.clone()
8126 }
8127}
8128impl MessageData for AUTH_KEY_DATA {
8129 type Message = MavMessage;
8130 const ID: u32 = 7u32;
8131 const NAME: &'static str = "AUTH_KEY";
8132 const EXTRA_CRC: u8 = 119u8;
8133 const ENCODED_LEN: usize = 32usize;
8134 fn deser(
8135 _version: MavlinkVersion,
8136 __input: &[u8],
8137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8138 let avail_len = __input.len();
8139 let mut payload_buf = [0; Self::ENCODED_LEN];
8140 let mut buf = if avail_len < Self::ENCODED_LEN {
8141 payload_buf[0..avail_len].copy_from_slice(__input);
8142 Bytes::new(&payload_buf)
8143 } else {
8144 Bytes::new(__input)
8145 };
8146 let mut __struct = Self::default();
8147 for v in &mut __struct.key {
8148 let val = buf.get_u8();
8149 *v = val;
8150 }
8151 Ok(__struct)
8152 }
8153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8154 let mut __tmp = BytesMut::new(bytes);
8155 #[allow(clippy::absurd_extreme_comparisons)]
8156 #[allow(unused_comparisons)]
8157 if __tmp.remaining() < Self::ENCODED_LEN {
8158 panic!(
8159 "buffer is too small (need {} bytes, but got {})",
8160 Self::ENCODED_LEN,
8161 __tmp.remaining(),
8162 )
8163 }
8164 for val in &self.key {
8165 __tmp.put_u8(*val);
8166 }
8167 if matches!(version, MavlinkVersion::V2) {
8168 let len = __tmp.len();
8169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8170 } else {
8171 __tmp.len()
8172 }
8173 }
8174}
8175#[doc = "id: 286"]
8176#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
8177#[derive(Debug, Clone, PartialEq)]
8178#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8180pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
8181 #[doc = "Timestamp (time since system boot)."]
8182 pub time_boot_us: u64,
8183 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
8184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8185 pub q: [f32; 4],
8186 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
8187 pub q_estimated_delay_us: u32,
8188 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
8189 pub vx: f32,
8190 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
8191 pub vy: f32,
8192 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
8193 pub vz: f32,
8194 #[doc = "Estimated delay of the speed data. 0 if unknown."]
8195 pub v_estimated_delay_us: u32,
8196 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
8197 pub feed_forward_angular_velocity_z: f32,
8198 #[doc = "Bitmap indicating which estimator outputs are valid."]
8199 pub estimator_status: EstimatorStatusFlags,
8200 #[doc = "System ID"]
8201 pub target_system: u8,
8202 #[doc = "Component ID"]
8203 pub target_component: u8,
8204 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
8205 pub landed_state: MavLandedState,
8206 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
8207 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8208 pub angular_velocity_z: f32,
8209}
8210impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
8211 pub const ENCODED_LEN: usize = 57usize;
8212 pub const DEFAULT: Self = Self {
8213 time_boot_us: 0_u64,
8214 q: [0.0_f32; 4usize],
8215 q_estimated_delay_us: 0_u32,
8216 vx: 0.0_f32,
8217 vy: 0.0_f32,
8218 vz: 0.0_f32,
8219 v_estimated_delay_us: 0_u32,
8220 feed_forward_angular_velocity_z: 0.0_f32,
8221 estimator_status: EstimatorStatusFlags::DEFAULT,
8222 target_system: 0_u8,
8223 target_component: 0_u8,
8224 landed_state: MavLandedState::DEFAULT,
8225 angular_velocity_z: 0.0_f32,
8226 };
8227 #[cfg(feature = "arbitrary")]
8228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8229 use arbitrary::{Arbitrary, Unstructured};
8230 let mut buf = [0u8; 1024];
8231 rng.fill_bytes(&mut buf);
8232 let mut unstructured = Unstructured::new(&buf);
8233 Self::arbitrary(&mut unstructured).unwrap_or_default()
8234 }
8235}
8236impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
8237 fn default() -> Self {
8238 Self::DEFAULT.clone()
8239 }
8240}
8241impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
8242 type Message = MavMessage;
8243 const ID: u32 = 286u32;
8244 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
8245 const EXTRA_CRC: u8 = 210u8;
8246 const ENCODED_LEN: usize = 57usize;
8247 fn deser(
8248 _version: MavlinkVersion,
8249 __input: &[u8],
8250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8251 let avail_len = __input.len();
8252 let mut payload_buf = [0; Self::ENCODED_LEN];
8253 let mut buf = if avail_len < Self::ENCODED_LEN {
8254 payload_buf[0..avail_len].copy_from_slice(__input);
8255 Bytes::new(&payload_buf)
8256 } else {
8257 Bytes::new(__input)
8258 };
8259 let mut __struct = Self::default();
8260 __struct.time_boot_us = buf.get_u64_le();
8261 for v in &mut __struct.q {
8262 let val = buf.get_f32_le();
8263 *v = val;
8264 }
8265 __struct.q_estimated_delay_us = buf.get_u32_le();
8266 __struct.vx = buf.get_f32_le();
8267 __struct.vy = buf.get_f32_le();
8268 __struct.vz = buf.get_f32_le();
8269 __struct.v_estimated_delay_us = buf.get_u32_le();
8270 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
8271 let tmp = buf.get_u16_le();
8272 __struct.estimator_status = EstimatorStatusFlags::from_bits(
8273 tmp & EstimatorStatusFlags::all().bits(),
8274 )
8275 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8276 flag_type: "EstimatorStatusFlags",
8277 value: tmp as u32,
8278 })?;
8279 __struct.target_system = buf.get_u8();
8280 __struct.target_component = buf.get_u8();
8281 let tmp = buf.get_u8();
8282 __struct.landed_state =
8283 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8284 enum_type: "MavLandedState",
8285 value: tmp as u32,
8286 })?;
8287 __struct.angular_velocity_z = buf.get_f32_le();
8288 Ok(__struct)
8289 }
8290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8291 let mut __tmp = BytesMut::new(bytes);
8292 #[allow(clippy::absurd_extreme_comparisons)]
8293 #[allow(unused_comparisons)]
8294 if __tmp.remaining() < Self::ENCODED_LEN {
8295 panic!(
8296 "buffer is too small (need {} bytes, but got {})",
8297 Self::ENCODED_LEN,
8298 __tmp.remaining(),
8299 )
8300 }
8301 __tmp.put_u64_le(self.time_boot_us);
8302 for val in &self.q {
8303 __tmp.put_f32_le(*val);
8304 }
8305 __tmp.put_u32_le(self.q_estimated_delay_us);
8306 __tmp.put_f32_le(self.vx);
8307 __tmp.put_f32_le(self.vy);
8308 __tmp.put_f32_le(self.vz);
8309 __tmp.put_u32_le(self.v_estimated_delay_us);
8310 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
8311 __tmp.put_u16_le(self.estimator_status.bits());
8312 __tmp.put_u8(self.target_system);
8313 __tmp.put_u8(self.target_component);
8314 __tmp.put_u8(self.landed_state as u8);
8315 __tmp.put_f32_le(self.angular_velocity_z);
8316 if matches!(version, MavlinkVersion::V2) {
8317 let len = __tmp.len();
8318 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8319 } else {
8320 __tmp.len()
8321 }
8322 }
8323}
8324#[doc = "id: 148"]
8325#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
8326#[derive(Debug, Clone, PartialEq)]
8327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8328#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8329pub struct AUTOPILOT_VERSION_DATA {
8330 #[doc = "Bitmap of capabilities"]
8331 pub capabilities: MavProtocolCapability,
8332 #[doc = "UID if provided by hardware (see uid2)"]
8333 pub uid: u64,
8334 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
8335 pub flight_sw_version: u32,
8336 #[doc = "Middleware version number"]
8337 pub middleware_sw_version: u32,
8338 #[doc = "Operating system version number"]
8339 pub os_sw_version: u32,
8340 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
8341 pub board_version: u32,
8342 #[doc = "ID of the board vendor"]
8343 pub vendor_id: u16,
8344 #[doc = "ID of the product"]
8345 pub product_id: u16,
8346 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
8347 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8348 pub flight_custom_version: [u8; 8],
8349 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
8350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8351 pub middleware_custom_version: [u8; 8],
8352 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
8353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8354 pub os_custom_version: [u8; 8],
8355 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
8356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8357 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8358 pub uid2: [u8; 18],
8359}
8360impl AUTOPILOT_VERSION_DATA {
8361 pub const ENCODED_LEN: usize = 78usize;
8362 pub const DEFAULT: Self = Self {
8363 capabilities: MavProtocolCapability::DEFAULT,
8364 uid: 0_u64,
8365 flight_sw_version: 0_u32,
8366 middleware_sw_version: 0_u32,
8367 os_sw_version: 0_u32,
8368 board_version: 0_u32,
8369 vendor_id: 0_u16,
8370 product_id: 0_u16,
8371 flight_custom_version: [0_u8; 8usize],
8372 middleware_custom_version: [0_u8; 8usize],
8373 os_custom_version: [0_u8; 8usize],
8374 uid2: [0_u8; 18usize],
8375 };
8376 #[cfg(feature = "arbitrary")]
8377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8378 use arbitrary::{Arbitrary, Unstructured};
8379 let mut buf = [0u8; 1024];
8380 rng.fill_bytes(&mut buf);
8381 let mut unstructured = Unstructured::new(&buf);
8382 Self::arbitrary(&mut unstructured).unwrap_or_default()
8383 }
8384}
8385impl Default for AUTOPILOT_VERSION_DATA {
8386 fn default() -> Self {
8387 Self::DEFAULT.clone()
8388 }
8389}
8390impl MessageData for AUTOPILOT_VERSION_DATA {
8391 type Message = MavMessage;
8392 const ID: u32 = 148u32;
8393 const NAME: &'static str = "AUTOPILOT_VERSION";
8394 const EXTRA_CRC: u8 = 178u8;
8395 const ENCODED_LEN: usize = 78usize;
8396 fn deser(
8397 _version: MavlinkVersion,
8398 __input: &[u8],
8399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8400 let avail_len = __input.len();
8401 let mut payload_buf = [0; Self::ENCODED_LEN];
8402 let mut buf = if avail_len < Self::ENCODED_LEN {
8403 payload_buf[0..avail_len].copy_from_slice(__input);
8404 Bytes::new(&payload_buf)
8405 } else {
8406 Bytes::new(__input)
8407 };
8408 let mut __struct = Self::default();
8409 let tmp = buf.get_u64_le();
8410 __struct.capabilities = MavProtocolCapability::from_bits(
8411 tmp & MavProtocolCapability::all().bits(),
8412 )
8413 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8414 flag_type: "MavProtocolCapability",
8415 value: tmp as u32,
8416 })?;
8417 __struct.uid = buf.get_u64_le();
8418 __struct.flight_sw_version = buf.get_u32_le();
8419 __struct.middleware_sw_version = buf.get_u32_le();
8420 __struct.os_sw_version = buf.get_u32_le();
8421 __struct.board_version = buf.get_u32_le();
8422 __struct.vendor_id = buf.get_u16_le();
8423 __struct.product_id = buf.get_u16_le();
8424 for v in &mut __struct.flight_custom_version {
8425 let val = buf.get_u8();
8426 *v = val;
8427 }
8428 for v in &mut __struct.middleware_custom_version {
8429 let val = buf.get_u8();
8430 *v = val;
8431 }
8432 for v in &mut __struct.os_custom_version {
8433 let val = buf.get_u8();
8434 *v = val;
8435 }
8436 for v in &mut __struct.uid2 {
8437 let val = buf.get_u8();
8438 *v = val;
8439 }
8440 Ok(__struct)
8441 }
8442 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8443 let mut __tmp = BytesMut::new(bytes);
8444 #[allow(clippy::absurd_extreme_comparisons)]
8445 #[allow(unused_comparisons)]
8446 if __tmp.remaining() < Self::ENCODED_LEN {
8447 panic!(
8448 "buffer is too small (need {} bytes, but got {})",
8449 Self::ENCODED_LEN,
8450 __tmp.remaining(),
8451 )
8452 }
8453 __tmp.put_u64_le(self.capabilities.bits());
8454 __tmp.put_u64_le(self.uid);
8455 __tmp.put_u32_le(self.flight_sw_version);
8456 __tmp.put_u32_le(self.middleware_sw_version);
8457 __tmp.put_u32_le(self.os_sw_version);
8458 __tmp.put_u32_le(self.board_version);
8459 __tmp.put_u16_le(self.vendor_id);
8460 __tmp.put_u16_le(self.product_id);
8461 for val in &self.flight_custom_version {
8462 __tmp.put_u8(*val);
8463 }
8464 for val in &self.middleware_custom_version {
8465 __tmp.put_u8(*val);
8466 }
8467 for val in &self.os_custom_version {
8468 __tmp.put_u8(*val);
8469 }
8470 for val in &self.uid2 {
8471 __tmp.put_u8(*val);
8472 }
8473 if matches!(version, MavlinkVersion::V2) {
8474 let len = __tmp.len();
8475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8476 } else {
8477 __tmp.len()
8478 }
8479 }
8480}
8481#[doc = "id: 183"]
8482#[doc = "Request the autopilot version from the system/component."]
8483#[derive(Debug, Clone, PartialEq)]
8484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8486pub struct AUTOPILOT_VERSION_REQUEST_DATA {
8487 #[doc = "System ID."]
8488 pub target_system: u8,
8489 #[doc = "Component ID."]
8490 pub target_component: u8,
8491}
8492impl AUTOPILOT_VERSION_REQUEST_DATA {
8493 pub const ENCODED_LEN: usize = 2usize;
8494 pub const DEFAULT: Self = Self {
8495 target_system: 0_u8,
8496 target_component: 0_u8,
8497 };
8498 #[cfg(feature = "arbitrary")]
8499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8500 use arbitrary::{Arbitrary, Unstructured};
8501 let mut buf = [0u8; 1024];
8502 rng.fill_bytes(&mut buf);
8503 let mut unstructured = Unstructured::new(&buf);
8504 Self::arbitrary(&mut unstructured).unwrap_or_default()
8505 }
8506}
8507impl Default for AUTOPILOT_VERSION_REQUEST_DATA {
8508 fn default() -> Self {
8509 Self::DEFAULT.clone()
8510 }
8511}
8512impl MessageData for AUTOPILOT_VERSION_REQUEST_DATA {
8513 type Message = MavMessage;
8514 const ID: u32 = 183u32;
8515 const NAME: &'static str = "AUTOPILOT_VERSION_REQUEST";
8516 const EXTRA_CRC: u8 = 85u8;
8517 const ENCODED_LEN: usize = 2usize;
8518 fn deser(
8519 _version: MavlinkVersion,
8520 __input: &[u8],
8521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8522 let avail_len = __input.len();
8523 let mut payload_buf = [0; Self::ENCODED_LEN];
8524 let mut buf = if avail_len < Self::ENCODED_LEN {
8525 payload_buf[0..avail_len].copy_from_slice(__input);
8526 Bytes::new(&payload_buf)
8527 } else {
8528 Bytes::new(__input)
8529 };
8530 let mut __struct = Self::default();
8531 __struct.target_system = buf.get_u8();
8532 __struct.target_component = buf.get_u8();
8533 Ok(__struct)
8534 }
8535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8536 let mut __tmp = BytesMut::new(bytes);
8537 #[allow(clippy::absurd_extreme_comparisons)]
8538 #[allow(unused_comparisons)]
8539 if __tmp.remaining() < Self::ENCODED_LEN {
8540 panic!(
8541 "buffer is too small (need {} bytes, but got {})",
8542 Self::ENCODED_LEN,
8543 __tmp.remaining(),
8544 )
8545 }
8546 __tmp.put_u8(self.target_system);
8547 __tmp.put_u8(self.target_component);
8548 if matches!(version, MavlinkVersion::V2) {
8549 let len = __tmp.len();
8550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8551 } else {
8552 __tmp.len()
8553 }
8554 }
8555}
8556#[doc = "id: 435"]
8557#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
8558#[derive(Debug, Clone, PartialEq)]
8559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8561pub struct AVAILABLE_MODES_DATA {
8562 #[doc = "A bitfield for use for autopilot-specific flags"]
8563 pub custom_mode: u32,
8564 #[doc = "Mode properties."]
8565 pub properties: MavModeProperty,
8566 #[doc = "The total number of available modes for the current vehicle type."]
8567 pub number_modes: u8,
8568 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
8569 pub mode_index: u8,
8570 #[doc = "Standard mode."]
8571 pub standard_mode: MavStandardMode,
8572 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
8573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8574 pub mode_name: [u8; 35],
8575}
8576impl AVAILABLE_MODES_DATA {
8577 pub const ENCODED_LEN: usize = 46usize;
8578 pub const DEFAULT: Self = Self {
8579 custom_mode: 0_u32,
8580 properties: MavModeProperty::DEFAULT,
8581 number_modes: 0_u8,
8582 mode_index: 0_u8,
8583 standard_mode: MavStandardMode::DEFAULT,
8584 mode_name: [0_u8; 35usize],
8585 };
8586 #[cfg(feature = "arbitrary")]
8587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8588 use arbitrary::{Arbitrary, Unstructured};
8589 let mut buf = [0u8; 1024];
8590 rng.fill_bytes(&mut buf);
8591 let mut unstructured = Unstructured::new(&buf);
8592 Self::arbitrary(&mut unstructured).unwrap_or_default()
8593 }
8594}
8595impl Default for AVAILABLE_MODES_DATA {
8596 fn default() -> Self {
8597 Self::DEFAULT.clone()
8598 }
8599}
8600impl MessageData for AVAILABLE_MODES_DATA {
8601 type Message = MavMessage;
8602 const ID: u32 = 435u32;
8603 const NAME: &'static str = "AVAILABLE_MODES";
8604 const EXTRA_CRC: u8 = 134u8;
8605 const ENCODED_LEN: usize = 46usize;
8606 fn deser(
8607 _version: MavlinkVersion,
8608 __input: &[u8],
8609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8610 let avail_len = __input.len();
8611 let mut payload_buf = [0; Self::ENCODED_LEN];
8612 let mut buf = if avail_len < Self::ENCODED_LEN {
8613 payload_buf[0..avail_len].copy_from_slice(__input);
8614 Bytes::new(&payload_buf)
8615 } else {
8616 Bytes::new(__input)
8617 };
8618 let mut __struct = Self::default();
8619 __struct.custom_mode = buf.get_u32_le();
8620 let tmp = buf.get_u32_le();
8621 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
8622 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8623 flag_type: "MavModeProperty",
8624 value: tmp as u32,
8625 })?;
8626 __struct.number_modes = buf.get_u8();
8627 __struct.mode_index = buf.get_u8();
8628 let tmp = buf.get_u8();
8629 __struct.standard_mode =
8630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8631 enum_type: "MavStandardMode",
8632 value: tmp as u32,
8633 })?;
8634 for v in &mut __struct.mode_name {
8635 let val = buf.get_u8();
8636 *v = val;
8637 }
8638 Ok(__struct)
8639 }
8640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8641 let mut __tmp = BytesMut::new(bytes);
8642 #[allow(clippy::absurd_extreme_comparisons)]
8643 #[allow(unused_comparisons)]
8644 if __tmp.remaining() < Self::ENCODED_LEN {
8645 panic!(
8646 "buffer is too small (need {} bytes, but got {})",
8647 Self::ENCODED_LEN,
8648 __tmp.remaining(),
8649 )
8650 }
8651 __tmp.put_u32_le(self.custom_mode);
8652 __tmp.put_u32_le(self.properties.bits());
8653 __tmp.put_u8(self.number_modes);
8654 __tmp.put_u8(self.mode_index);
8655 __tmp.put_u8(self.standard_mode as u8);
8656 for val in &self.mode_name {
8657 __tmp.put_u8(*val);
8658 }
8659 if matches!(version, MavlinkVersion::V2) {
8660 let len = __tmp.len();
8661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8662 } else {
8663 __tmp.len()
8664 }
8665 }
8666}
8667#[doc = "id: 437"]
8668#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
8669#[derive(Debug, Clone, PartialEq)]
8670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8672pub struct AVAILABLE_MODES_MONITOR_DATA {
8673 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
8674 pub seq: u8,
8675}
8676impl AVAILABLE_MODES_MONITOR_DATA {
8677 pub const ENCODED_LEN: usize = 1usize;
8678 pub const DEFAULT: Self = Self { seq: 0_u8 };
8679 #[cfg(feature = "arbitrary")]
8680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8681 use arbitrary::{Arbitrary, Unstructured};
8682 let mut buf = [0u8; 1024];
8683 rng.fill_bytes(&mut buf);
8684 let mut unstructured = Unstructured::new(&buf);
8685 Self::arbitrary(&mut unstructured).unwrap_or_default()
8686 }
8687}
8688impl Default for AVAILABLE_MODES_MONITOR_DATA {
8689 fn default() -> Self {
8690 Self::DEFAULT.clone()
8691 }
8692}
8693impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
8694 type Message = MavMessage;
8695 const ID: u32 = 437u32;
8696 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
8697 const EXTRA_CRC: u8 = 30u8;
8698 const ENCODED_LEN: usize = 1usize;
8699 fn deser(
8700 _version: MavlinkVersion,
8701 __input: &[u8],
8702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8703 let avail_len = __input.len();
8704 let mut payload_buf = [0; Self::ENCODED_LEN];
8705 let mut buf = if avail_len < Self::ENCODED_LEN {
8706 payload_buf[0..avail_len].copy_from_slice(__input);
8707 Bytes::new(&payload_buf)
8708 } else {
8709 Bytes::new(__input)
8710 };
8711 let mut __struct = Self::default();
8712 __struct.seq = buf.get_u8();
8713 Ok(__struct)
8714 }
8715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8716 let mut __tmp = BytesMut::new(bytes);
8717 #[allow(clippy::absurd_extreme_comparisons)]
8718 #[allow(unused_comparisons)]
8719 if __tmp.remaining() < Self::ENCODED_LEN {
8720 panic!(
8721 "buffer is too small (need {} bytes, but got {})",
8722 Self::ENCODED_LEN,
8723 __tmp.remaining(),
8724 )
8725 }
8726 __tmp.put_u8(self.seq);
8727 if matches!(version, MavlinkVersion::V2) {
8728 let len = __tmp.len();
8729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8730 } else {
8731 __tmp.len()
8732 }
8733 }
8734}
8735#[deprecated = " See `BATTERY_STATUS` (Deprecated since 2017-04)"]
8736#[doc = "id: 181"]
8737#[doc = "2nd Battery status."]
8738#[derive(Debug, Clone, PartialEq)]
8739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8741pub struct BATTERY2_DATA {
8742 #[doc = "Voltage."]
8743 pub voltage: u16,
8744 #[doc = "Battery current, -1: autopilot does not measure the current."]
8745 pub current_battery: i16,
8746}
8747impl BATTERY2_DATA {
8748 pub const ENCODED_LEN: usize = 4usize;
8749 pub const DEFAULT: Self = Self {
8750 voltage: 0_u16,
8751 current_battery: 0_i16,
8752 };
8753 #[cfg(feature = "arbitrary")]
8754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8755 use arbitrary::{Arbitrary, Unstructured};
8756 let mut buf = [0u8; 1024];
8757 rng.fill_bytes(&mut buf);
8758 let mut unstructured = Unstructured::new(&buf);
8759 Self::arbitrary(&mut unstructured).unwrap_or_default()
8760 }
8761}
8762impl Default for BATTERY2_DATA {
8763 fn default() -> Self {
8764 Self::DEFAULT.clone()
8765 }
8766}
8767impl MessageData for BATTERY2_DATA {
8768 type Message = MavMessage;
8769 const ID: u32 = 181u32;
8770 const NAME: &'static str = "BATTERY2";
8771 const EXTRA_CRC: u8 = 174u8;
8772 const ENCODED_LEN: usize = 4usize;
8773 fn deser(
8774 _version: MavlinkVersion,
8775 __input: &[u8],
8776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8777 let avail_len = __input.len();
8778 let mut payload_buf = [0; Self::ENCODED_LEN];
8779 let mut buf = if avail_len < Self::ENCODED_LEN {
8780 payload_buf[0..avail_len].copy_from_slice(__input);
8781 Bytes::new(&payload_buf)
8782 } else {
8783 Bytes::new(__input)
8784 };
8785 let mut __struct = Self::default();
8786 __struct.voltage = buf.get_u16_le();
8787 __struct.current_battery = buf.get_i16_le();
8788 Ok(__struct)
8789 }
8790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8791 let mut __tmp = BytesMut::new(bytes);
8792 #[allow(clippy::absurd_extreme_comparisons)]
8793 #[allow(unused_comparisons)]
8794 if __tmp.remaining() < Self::ENCODED_LEN {
8795 panic!(
8796 "buffer is too small (need {} bytes, but got {})",
8797 Self::ENCODED_LEN,
8798 __tmp.remaining(),
8799 )
8800 }
8801 __tmp.put_u16_le(self.voltage);
8802 __tmp.put_i16_le(self.current_battery);
8803 if matches!(version, MavlinkVersion::V2) {
8804 let len = __tmp.len();
8805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8806 } else {
8807 __tmp.len()
8808 }
8809 }
8810}
8811#[doc = "id: 372"]
8812#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
8813#[derive(Debug, Clone, PartialEq)]
8814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8816pub struct BATTERY_INFO_DATA {
8817 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
8818 pub discharge_minimum_voltage: f32,
8819 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
8820 pub charging_minimum_voltage: f32,
8821 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
8822 pub resting_minimum_voltage: f32,
8823 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
8824 pub charging_maximum_voltage: f32,
8825 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
8826 pub charging_maximum_current: f32,
8827 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
8828 pub nominal_voltage: f32,
8829 #[doc = "Maximum pack discharge current. 0: field not provided."]
8830 pub discharge_maximum_current: f32,
8831 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
8832 pub discharge_maximum_burst_current: f32,
8833 #[doc = "Fully charged design capacity. 0: field not provided."]
8834 pub design_capacity: f32,
8835 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
8836 pub full_charge_capacity: f32,
8837 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
8838 pub cycle_count: u16,
8839 #[doc = "Battery weight. 0: field not provided."]
8840 pub weight: u16,
8841 #[doc = "Battery ID"]
8842 pub id: u8,
8843 #[doc = "Function of the battery."]
8844 pub battery_function: MavBatteryFunction,
8845 #[doc = "Type (chemistry) of the battery."]
8846 pub mavtype: MavBatteryType,
8847 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
8848 pub state_of_health: u8,
8849 #[doc = "Number of battery cells in series. 0: field not provided."]
8850 pub cells_in_series: u8,
8851 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
8852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8853 pub manufacture_date: [u8; 9],
8854 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
8855 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8856 pub serial_number: [u8; 32],
8857 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
8858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8859 pub name: [u8; 50],
8860}
8861impl BATTERY_INFO_DATA {
8862 pub const ENCODED_LEN: usize = 140usize;
8863 pub const DEFAULT: Self = Self {
8864 discharge_minimum_voltage: 0.0_f32,
8865 charging_minimum_voltage: 0.0_f32,
8866 resting_minimum_voltage: 0.0_f32,
8867 charging_maximum_voltage: 0.0_f32,
8868 charging_maximum_current: 0.0_f32,
8869 nominal_voltage: 0.0_f32,
8870 discharge_maximum_current: 0.0_f32,
8871 discharge_maximum_burst_current: 0.0_f32,
8872 design_capacity: 0.0_f32,
8873 full_charge_capacity: 0.0_f32,
8874 cycle_count: 0_u16,
8875 weight: 0_u16,
8876 id: 0_u8,
8877 battery_function: MavBatteryFunction::DEFAULT,
8878 mavtype: MavBatteryType::DEFAULT,
8879 state_of_health: 0_u8,
8880 cells_in_series: 0_u8,
8881 manufacture_date: [0_u8; 9usize],
8882 serial_number: [0_u8; 32usize],
8883 name: [0_u8; 50usize],
8884 };
8885 #[cfg(feature = "arbitrary")]
8886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8887 use arbitrary::{Arbitrary, Unstructured};
8888 let mut buf = [0u8; 1024];
8889 rng.fill_bytes(&mut buf);
8890 let mut unstructured = Unstructured::new(&buf);
8891 Self::arbitrary(&mut unstructured).unwrap_or_default()
8892 }
8893}
8894impl Default for BATTERY_INFO_DATA {
8895 fn default() -> Self {
8896 Self::DEFAULT.clone()
8897 }
8898}
8899impl MessageData for BATTERY_INFO_DATA {
8900 type Message = MavMessage;
8901 const ID: u32 = 372u32;
8902 const NAME: &'static str = "BATTERY_INFO";
8903 const EXTRA_CRC: u8 = 26u8;
8904 const ENCODED_LEN: usize = 140usize;
8905 fn deser(
8906 _version: MavlinkVersion,
8907 __input: &[u8],
8908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8909 let avail_len = __input.len();
8910 let mut payload_buf = [0; Self::ENCODED_LEN];
8911 let mut buf = if avail_len < Self::ENCODED_LEN {
8912 payload_buf[0..avail_len].copy_from_slice(__input);
8913 Bytes::new(&payload_buf)
8914 } else {
8915 Bytes::new(__input)
8916 };
8917 let mut __struct = Self::default();
8918 __struct.discharge_minimum_voltage = buf.get_f32_le();
8919 __struct.charging_minimum_voltage = buf.get_f32_le();
8920 __struct.resting_minimum_voltage = buf.get_f32_le();
8921 __struct.charging_maximum_voltage = buf.get_f32_le();
8922 __struct.charging_maximum_current = buf.get_f32_le();
8923 __struct.nominal_voltage = buf.get_f32_le();
8924 __struct.discharge_maximum_current = buf.get_f32_le();
8925 __struct.discharge_maximum_burst_current = buf.get_f32_le();
8926 __struct.design_capacity = buf.get_f32_le();
8927 __struct.full_charge_capacity = buf.get_f32_le();
8928 __struct.cycle_count = buf.get_u16_le();
8929 __struct.weight = buf.get_u16_le();
8930 __struct.id = buf.get_u8();
8931 let tmp = buf.get_u8();
8932 __struct.battery_function =
8933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8934 enum_type: "MavBatteryFunction",
8935 value: tmp as u32,
8936 })?;
8937 let tmp = buf.get_u8();
8938 __struct.mavtype =
8939 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8940 enum_type: "MavBatteryType",
8941 value: tmp as u32,
8942 })?;
8943 __struct.state_of_health = buf.get_u8();
8944 __struct.cells_in_series = buf.get_u8();
8945 for v in &mut __struct.manufacture_date {
8946 let val = buf.get_u8();
8947 *v = val;
8948 }
8949 for v in &mut __struct.serial_number {
8950 let val = buf.get_u8();
8951 *v = val;
8952 }
8953 for v in &mut __struct.name {
8954 let val = buf.get_u8();
8955 *v = val;
8956 }
8957 Ok(__struct)
8958 }
8959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8960 let mut __tmp = BytesMut::new(bytes);
8961 #[allow(clippy::absurd_extreme_comparisons)]
8962 #[allow(unused_comparisons)]
8963 if __tmp.remaining() < Self::ENCODED_LEN {
8964 panic!(
8965 "buffer is too small (need {} bytes, but got {})",
8966 Self::ENCODED_LEN,
8967 __tmp.remaining(),
8968 )
8969 }
8970 __tmp.put_f32_le(self.discharge_minimum_voltage);
8971 __tmp.put_f32_le(self.charging_minimum_voltage);
8972 __tmp.put_f32_le(self.resting_minimum_voltage);
8973 __tmp.put_f32_le(self.charging_maximum_voltage);
8974 __tmp.put_f32_le(self.charging_maximum_current);
8975 __tmp.put_f32_le(self.nominal_voltage);
8976 __tmp.put_f32_le(self.discharge_maximum_current);
8977 __tmp.put_f32_le(self.discharge_maximum_burst_current);
8978 __tmp.put_f32_le(self.design_capacity);
8979 __tmp.put_f32_le(self.full_charge_capacity);
8980 __tmp.put_u16_le(self.cycle_count);
8981 __tmp.put_u16_le(self.weight);
8982 __tmp.put_u8(self.id);
8983 __tmp.put_u8(self.battery_function as u8);
8984 __tmp.put_u8(self.mavtype as u8);
8985 __tmp.put_u8(self.state_of_health);
8986 __tmp.put_u8(self.cells_in_series);
8987 for val in &self.manufacture_date {
8988 __tmp.put_u8(*val);
8989 }
8990 for val in &self.serial_number {
8991 __tmp.put_u8(*val);
8992 }
8993 for val in &self.name {
8994 __tmp.put_u8(*val);
8995 }
8996 if matches!(version, MavlinkVersion::V2) {
8997 let len = __tmp.len();
8998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8999 } else {
9000 __tmp.len()
9001 }
9002 }
9003}
9004#[doc = "id: 147"]
9005#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
9006#[derive(Debug, Clone, PartialEq)]
9007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9009pub struct BATTERY_STATUS_DATA {
9010 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
9011 pub current_consumed: i32,
9012 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
9013 pub energy_consumed: i32,
9014 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
9015 pub temperature: i16,
9016 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
9017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9018 pub voltages: [u16; 10],
9019 #[doc = "Battery current, -1: autopilot does not measure the current"]
9020 pub current_battery: i16,
9021 #[doc = "Battery ID"]
9022 pub id: u8,
9023 #[doc = "Function of the battery"]
9024 pub battery_function: MavBatteryFunction,
9025 #[doc = "Type (chemistry) of the battery"]
9026 pub mavtype: MavBatteryType,
9027 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
9028 pub battery_remaining: i8,
9029 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
9030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9031 pub time_remaining: i32,
9032 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
9033 #[cfg_attr(feature = "serde", serde(default))]
9034 pub charge_state: MavBatteryChargeState,
9035 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
9036 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9038 pub voltages_ext: [u16; 4],
9039 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
9040 #[cfg_attr(feature = "serde", serde(default))]
9041 pub mode: MavBatteryMode,
9042 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
9043 #[cfg_attr(feature = "serde", serde(default))]
9044 pub fault_bitmask: MavBatteryFault,
9045}
9046impl BATTERY_STATUS_DATA {
9047 pub const ENCODED_LEN: usize = 54usize;
9048 pub const DEFAULT: Self = Self {
9049 current_consumed: 0_i32,
9050 energy_consumed: 0_i32,
9051 temperature: 0_i16,
9052 voltages: [0_u16; 10usize],
9053 current_battery: 0_i16,
9054 id: 0_u8,
9055 battery_function: MavBatteryFunction::DEFAULT,
9056 mavtype: MavBatteryType::DEFAULT,
9057 battery_remaining: 0_i8,
9058 time_remaining: 0_i32,
9059 charge_state: MavBatteryChargeState::DEFAULT,
9060 voltages_ext: [0_u16; 4usize],
9061 mode: MavBatteryMode::DEFAULT,
9062 fault_bitmask: MavBatteryFault::DEFAULT,
9063 };
9064 #[cfg(feature = "arbitrary")]
9065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9066 use arbitrary::{Arbitrary, Unstructured};
9067 let mut buf = [0u8; 1024];
9068 rng.fill_bytes(&mut buf);
9069 let mut unstructured = Unstructured::new(&buf);
9070 Self::arbitrary(&mut unstructured).unwrap_or_default()
9071 }
9072}
9073impl Default for BATTERY_STATUS_DATA {
9074 fn default() -> Self {
9075 Self::DEFAULT.clone()
9076 }
9077}
9078impl MessageData for BATTERY_STATUS_DATA {
9079 type Message = MavMessage;
9080 const ID: u32 = 147u32;
9081 const NAME: &'static str = "BATTERY_STATUS";
9082 const EXTRA_CRC: u8 = 154u8;
9083 const ENCODED_LEN: usize = 54usize;
9084 fn deser(
9085 _version: MavlinkVersion,
9086 __input: &[u8],
9087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9088 let avail_len = __input.len();
9089 let mut payload_buf = [0; Self::ENCODED_LEN];
9090 let mut buf = if avail_len < Self::ENCODED_LEN {
9091 payload_buf[0..avail_len].copy_from_slice(__input);
9092 Bytes::new(&payload_buf)
9093 } else {
9094 Bytes::new(__input)
9095 };
9096 let mut __struct = Self::default();
9097 __struct.current_consumed = buf.get_i32_le();
9098 __struct.energy_consumed = buf.get_i32_le();
9099 __struct.temperature = buf.get_i16_le();
9100 for v in &mut __struct.voltages {
9101 let val = buf.get_u16_le();
9102 *v = val;
9103 }
9104 __struct.current_battery = buf.get_i16_le();
9105 __struct.id = buf.get_u8();
9106 let tmp = buf.get_u8();
9107 __struct.battery_function =
9108 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9109 enum_type: "MavBatteryFunction",
9110 value: tmp as u32,
9111 })?;
9112 let tmp = buf.get_u8();
9113 __struct.mavtype =
9114 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9115 enum_type: "MavBatteryType",
9116 value: tmp as u32,
9117 })?;
9118 __struct.battery_remaining = buf.get_i8();
9119 __struct.time_remaining = buf.get_i32_le();
9120 let tmp = buf.get_u8();
9121 __struct.charge_state =
9122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9123 enum_type: "MavBatteryChargeState",
9124 value: tmp as u32,
9125 })?;
9126 for v in &mut __struct.voltages_ext {
9127 let val = buf.get_u16_le();
9128 *v = val;
9129 }
9130 let tmp = buf.get_u8();
9131 __struct.mode =
9132 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9133 enum_type: "MavBatteryMode",
9134 value: tmp as u32,
9135 })?;
9136 let tmp = buf.get_u32_le();
9137 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
9138 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9139 flag_type: "MavBatteryFault",
9140 value: tmp as u32,
9141 })?;
9142 Ok(__struct)
9143 }
9144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9145 let mut __tmp = BytesMut::new(bytes);
9146 #[allow(clippy::absurd_extreme_comparisons)]
9147 #[allow(unused_comparisons)]
9148 if __tmp.remaining() < Self::ENCODED_LEN {
9149 panic!(
9150 "buffer is too small (need {} bytes, but got {})",
9151 Self::ENCODED_LEN,
9152 __tmp.remaining(),
9153 )
9154 }
9155 __tmp.put_i32_le(self.current_consumed);
9156 __tmp.put_i32_le(self.energy_consumed);
9157 __tmp.put_i16_le(self.temperature);
9158 for val in &self.voltages {
9159 __tmp.put_u16_le(*val);
9160 }
9161 __tmp.put_i16_le(self.current_battery);
9162 __tmp.put_u8(self.id);
9163 __tmp.put_u8(self.battery_function as u8);
9164 __tmp.put_u8(self.mavtype as u8);
9165 __tmp.put_i8(self.battery_remaining);
9166 __tmp.put_i32_le(self.time_remaining);
9167 __tmp.put_u8(self.charge_state as u8);
9168 for val in &self.voltages_ext {
9169 __tmp.put_u16_le(*val);
9170 }
9171 __tmp.put_u8(self.mode as u8);
9172 __tmp.put_u32_le(self.fault_bitmask.bits());
9173 if matches!(version, MavlinkVersion::V2) {
9174 let len = __tmp.len();
9175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9176 } else {
9177 __tmp.len()
9178 }
9179 }
9180}
9181#[doc = "id: 257"]
9182#[doc = "Report button state change."]
9183#[derive(Debug, Clone, PartialEq)]
9184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9185#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9186pub struct BUTTON_CHANGE_DATA {
9187 #[doc = "Timestamp (time since system boot)."]
9188 pub time_boot_ms: u32,
9189 #[doc = "Time of last change of button state."]
9190 pub last_change_ms: u32,
9191 #[doc = "Bitmap for state of buttons."]
9192 pub state: u8,
9193}
9194impl BUTTON_CHANGE_DATA {
9195 pub const ENCODED_LEN: usize = 9usize;
9196 pub const DEFAULT: Self = Self {
9197 time_boot_ms: 0_u32,
9198 last_change_ms: 0_u32,
9199 state: 0_u8,
9200 };
9201 #[cfg(feature = "arbitrary")]
9202 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9203 use arbitrary::{Arbitrary, Unstructured};
9204 let mut buf = [0u8; 1024];
9205 rng.fill_bytes(&mut buf);
9206 let mut unstructured = Unstructured::new(&buf);
9207 Self::arbitrary(&mut unstructured).unwrap_or_default()
9208 }
9209}
9210impl Default for BUTTON_CHANGE_DATA {
9211 fn default() -> Self {
9212 Self::DEFAULT.clone()
9213 }
9214}
9215impl MessageData for BUTTON_CHANGE_DATA {
9216 type Message = MavMessage;
9217 const ID: u32 = 257u32;
9218 const NAME: &'static str = "BUTTON_CHANGE";
9219 const EXTRA_CRC: u8 = 131u8;
9220 const ENCODED_LEN: usize = 9usize;
9221 fn deser(
9222 _version: MavlinkVersion,
9223 __input: &[u8],
9224 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9225 let avail_len = __input.len();
9226 let mut payload_buf = [0; Self::ENCODED_LEN];
9227 let mut buf = if avail_len < Self::ENCODED_LEN {
9228 payload_buf[0..avail_len].copy_from_slice(__input);
9229 Bytes::new(&payload_buf)
9230 } else {
9231 Bytes::new(__input)
9232 };
9233 let mut __struct = Self::default();
9234 __struct.time_boot_ms = buf.get_u32_le();
9235 __struct.last_change_ms = buf.get_u32_le();
9236 __struct.state = buf.get_u8();
9237 Ok(__struct)
9238 }
9239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9240 let mut __tmp = BytesMut::new(bytes);
9241 #[allow(clippy::absurd_extreme_comparisons)]
9242 #[allow(unused_comparisons)]
9243 if __tmp.remaining() < Self::ENCODED_LEN {
9244 panic!(
9245 "buffer is too small (need {} bytes, but got {})",
9246 Self::ENCODED_LEN,
9247 __tmp.remaining(),
9248 )
9249 }
9250 __tmp.put_u32_le(self.time_boot_ms);
9251 __tmp.put_u32_le(self.last_change_ms);
9252 __tmp.put_u8(self.state);
9253 if matches!(version, MavlinkVersion::V2) {
9254 let len = __tmp.len();
9255 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9256 } else {
9257 __tmp.len()
9258 }
9259 }
9260}
9261#[doc = "id: 262"]
9262#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9263#[derive(Debug, Clone, PartialEq)]
9264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9266pub struct CAMERA_CAPTURE_STATUS_DATA {
9267 #[doc = "Timestamp (time since system boot)."]
9268 pub time_boot_ms: u32,
9269 #[doc = "Image capture interval"]
9270 pub image_interval: f32,
9271 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
9272 pub recording_time_ms: u32,
9273 #[doc = "Available storage capacity."]
9274 pub available_capacity: f32,
9275 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
9276 pub image_status: u8,
9277 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
9278 pub video_status: u8,
9279 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
9280 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9281 pub image_count: i32,
9282 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9283 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9284 pub camera_device_id: u8,
9285}
9286impl CAMERA_CAPTURE_STATUS_DATA {
9287 pub const ENCODED_LEN: usize = 23usize;
9288 pub const DEFAULT: Self = Self {
9289 time_boot_ms: 0_u32,
9290 image_interval: 0.0_f32,
9291 recording_time_ms: 0_u32,
9292 available_capacity: 0.0_f32,
9293 image_status: 0_u8,
9294 video_status: 0_u8,
9295 image_count: 0_i32,
9296 camera_device_id: 0_u8,
9297 };
9298 #[cfg(feature = "arbitrary")]
9299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9300 use arbitrary::{Arbitrary, Unstructured};
9301 let mut buf = [0u8; 1024];
9302 rng.fill_bytes(&mut buf);
9303 let mut unstructured = Unstructured::new(&buf);
9304 Self::arbitrary(&mut unstructured).unwrap_or_default()
9305 }
9306}
9307impl Default for CAMERA_CAPTURE_STATUS_DATA {
9308 fn default() -> Self {
9309 Self::DEFAULT.clone()
9310 }
9311}
9312impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
9313 type Message = MavMessage;
9314 const ID: u32 = 262u32;
9315 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
9316 const EXTRA_CRC: u8 = 12u8;
9317 const ENCODED_LEN: usize = 23usize;
9318 fn deser(
9319 _version: MavlinkVersion,
9320 __input: &[u8],
9321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9322 let avail_len = __input.len();
9323 let mut payload_buf = [0; Self::ENCODED_LEN];
9324 let mut buf = if avail_len < Self::ENCODED_LEN {
9325 payload_buf[0..avail_len].copy_from_slice(__input);
9326 Bytes::new(&payload_buf)
9327 } else {
9328 Bytes::new(__input)
9329 };
9330 let mut __struct = Self::default();
9331 __struct.time_boot_ms = buf.get_u32_le();
9332 __struct.image_interval = buf.get_f32_le();
9333 __struct.recording_time_ms = buf.get_u32_le();
9334 __struct.available_capacity = buf.get_f32_le();
9335 __struct.image_status = buf.get_u8();
9336 __struct.video_status = buf.get_u8();
9337 __struct.image_count = buf.get_i32_le();
9338 __struct.camera_device_id = buf.get_u8();
9339 Ok(__struct)
9340 }
9341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9342 let mut __tmp = BytesMut::new(bytes);
9343 #[allow(clippy::absurd_extreme_comparisons)]
9344 #[allow(unused_comparisons)]
9345 if __tmp.remaining() < Self::ENCODED_LEN {
9346 panic!(
9347 "buffer is too small (need {} bytes, but got {})",
9348 Self::ENCODED_LEN,
9349 __tmp.remaining(),
9350 )
9351 }
9352 __tmp.put_u32_le(self.time_boot_ms);
9353 __tmp.put_f32_le(self.image_interval);
9354 __tmp.put_u32_le(self.recording_time_ms);
9355 __tmp.put_f32_le(self.available_capacity);
9356 __tmp.put_u8(self.image_status);
9357 __tmp.put_u8(self.video_status);
9358 __tmp.put_i32_le(self.image_count);
9359 __tmp.put_u8(self.camera_device_id);
9360 if matches!(version, MavlinkVersion::V2) {
9361 let len = __tmp.len();
9362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9363 } else {
9364 __tmp.len()
9365 }
9366 }
9367}
9368#[doc = "id: 180"]
9369#[doc = "Camera Capture Feedback."]
9370#[derive(Debug, Clone, PartialEq)]
9371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9373pub struct CAMERA_FEEDBACK_DATA {
9374 #[doc = "Image timestamp (since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)."]
9375 pub time_usec: u64,
9376 #[doc = "Latitude."]
9377 pub lat: i32,
9378 #[doc = "Longitude."]
9379 pub lng: i32,
9380 #[doc = "Altitude (MSL)."]
9381 pub alt_msl: f32,
9382 #[doc = "Altitude (Relative to HOME location)."]
9383 pub alt_rel: f32,
9384 #[doc = "Camera Roll angle (earth frame, +-180)."]
9385 pub roll: f32,
9386 #[doc = "Camera Pitch angle (earth frame, +-180)."]
9387 pub pitch: f32,
9388 #[doc = "Camera Yaw (earth frame, 0-360, true)."]
9389 pub yaw: f32,
9390 #[doc = "Focal Length."]
9391 pub foc_len: f32,
9392 #[doc = "Image index."]
9393 pub img_idx: u16,
9394 #[doc = "System ID."]
9395 pub target_system: u8,
9396 #[doc = "Camera ID."]
9397 pub cam_idx: u8,
9398 #[doc = "Feedback flags."]
9399 pub flags: CameraFeedbackFlags,
9400 #[doc = "Completed image captures."]
9401 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9402 pub completed_captures: u16,
9403}
9404impl CAMERA_FEEDBACK_DATA {
9405 pub const ENCODED_LEN: usize = 47usize;
9406 pub const DEFAULT: Self = Self {
9407 time_usec: 0_u64,
9408 lat: 0_i32,
9409 lng: 0_i32,
9410 alt_msl: 0.0_f32,
9411 alt_rel: 0.0_f32,
9412 roll: 0.0_f32,
9413 pitch: 0.0_f32,
9414 yaw: 0.0_f32,
9415 foc_len: 0.0_f32,
9416 img_idx: 0_u16,
9417 target_system: 0_u8,
9418 cam_idx: 0_u8,
9419 flags: CameraFeedbackFlags::DEFAULT,
9420 completed_captures: 0_u16,
9421 };
9422 #[cfg(feature = "arbitrary")]
9423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9424 use arbitrary::{Arbitrary, Unstructured};
9425 let mut buf = [0u8; 1024];
9426 rng.fill_bytes(&mut buf);
9427 let mut unstructured = Unstructured::new(&buf);
9428 Self::arbitrary(&mut unstructured).unwrap_or_default()
9429 }
9430}
9431impl Default for CAMERA_FEEDBACK_DATA {
9432 fn default() -> Self {
9433 Self::DEFAULT.clone()
9434 }
9435}
9436impl MessageData for CAMERA_FEEDBACK_DATA {
9437 type Message = MavMessage;
9438 const ID: u32 = 180u32;
9439 const NAME: &'static str = "CAMERA_FEEDBACK";
9440 const EXTRA_CRC: u8 = 52u8;
9441 const ENCODED_LEN: usize = 47usize;
9442 fn deser(
9443 _version: MavlinkVersion,
9444 __input: &[u8],
9445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9446 let avail_len = __input.len();
9447 let mut payload_buf = [0; Self::ENCODED_LEN];
9448 let mut buf = if avail_len < Self::ENCODED_LEN {
9449 payload_buf[0..avail_len].copy_from_slice(__input);
9450 Bytes::new(&payload_buf)
9451 } else {
9452 Bytes::new(__input)
9453 };
9454 let mut __struct = Self::default();
9455 __struct.time_usec = buf.get_u64_le();
9456 __struct.lat = buf.get_i32_le();
9457 __struct.lng = buf.get_i32_le();
9458 __struct.alt_msl = buf.get_f32_le();
9459 __struct.alt_rel = buf.get_f32_le();
9460 __struct.roll = buf.get_f32_le();
9461 __struct.pitch = buf.get_f32_le();
9462 __struct.yaw = buf.get_f32_le();
9463 __struct.foc_len = buf.get_f32_le();
9464 __struct.img_idx = buf.get_u16_le();
9465 __struct.target_system = buf.get_u8();
9466 __struct.cam_idx = buf.get_u8();
9467 let tmp = buf.get_u8();
9468 __struct.flags =
9469 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9470 enum_type: "CameraFeedbackFlags",
9471 value: tmp as u32,
9472 })?;
9473 __struct.completed_captures = buf.get_u16_le();
9474 Ok(__struct)
9475 }
9476 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9477 let mut __tmp = BytesMut::new(bytes);
9478 #[allow(clippy::absurd_extreme_comparisons)]
9479 #[allow(unused_comparisons)]
9480 if __tmp.remaining() < Self::ENCODED_LEN {
9481 panic!(
9482 "buffer is too small (need {} bytes, but got {})",
9483 Self::ENCODED_LEN,
9484 __tmp.remaining(),
9485 )
9486 }
9487 __tmp.put_u64_le(self.time_usec);
9488 __tmp.put_i32_le(self.lat);
9489 __tmp.put_i32_le(self.lng);
9490 __tmp.put_f32_le(self.alt_msl);
9491 __tmp.put_f32_le(self.alt_rel);
9492 __tmp.put_f32_le(self.roll);
9493 __tmp.put_f32_le(self.pitch);
9494 __tmp.put_f32_le(self.yaw);
9495 __tmp.put_f32_le(self.foc_len);
9496 __tmp.put_u16_le(self.img_idx);
9497 __tmp.put_u8(self.target_system);
9498 __tmp.put_u8(self.cam_idx);
9499 __tmp.put_u8(self.flags as u8);
9500 __tmp.put_u16_le(self.completed_captures);
9501 if matches!(version, MavlinkVersion::V2) {
9502 let len = __tmp.len();
9503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9504 } else {
9505 __tmp.len()
9506 }
9507 }
9508}
9509#[doc = "id: 271"]
9510#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9511#[derive(Debug, Clone, PartialEq)]
9512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9514pub struct CAMERA_FOV_STATUS_DATA {
9515 #[doc = "Timestamp (time since system boot)."]
9516 pub time_boot_ms: u32,
9517 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
9518 pub lat_camera: i32,
9519 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
9520 pub lon_camera: i32,
9521 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
9522 pub alt_camera: i32,
9523 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
9524 pub lat_image: i32,
9525 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
9526 pub lon_image: i32,
9527 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
9528 pub alt_image: i32,
9529 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
9530 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9531 pub q: [f32; 4],
9532 #[doc = "Horizontal field of view (NaN if unknown)."]
9533 pub hfov: f32,
9534 #[doc = "Vertical field of view (NaN if unknown)."]
9535 pub vfov: f32,
9536 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9538 pub camera_device_id: u8,
9539}
9540impl CAMERA_FOV_STATUS_DATA {
9541 pub const ENCODED_LEN: usize = 53usize;
9542 pub const DEFAULT: Self = Self {
9543 time_boot_ms: 0_u32,
9544 lat_camera: 0_i32,
9545 lon_camera: 0_i32,
9546 alt_camera: 0_i32,
9547 lat_image: 0_i32,
9548 lon_image: 0_i32,
9549 alt_image: 0_i32,
9550 q: [0.0_f32; 4usize],
9551 hfov: 0.0_f32,
9552 vfov: 0.0_f32,
9553 camera_device_id: 0_u8,
9554 };
9555 #[cfg(feature = "arbitrary")]
9556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9557 use arbitrary::{Arbitrary, Unstructured};
9558 let mut buf = [0u8; 1024];
9559 rng.fill_bytes(&mut buf);
9560 let mut unstructured = Unstructured::new(&buf);
9561 Self::arbitrary(&mut unstructured).unwrap_or_default()
9562 }
9563}
9564impl Default for CAMERA_FOV_STATUS_DATA {
9565 fn default() -> Self {
9566 Self::DEFAULT.clone()
9567 }
9568}
9569impl MessageData for CAMERA_FOV_STATUS_DATA {
9570 type Message = MavMessage;
9571 const ID: u32 = 271u32;
9572 const NAME: &'static str = "CAMERA_FOV_STATUS";
9573 const EXTRA_CRC: u8 = 22u8;
9574 const ENCODED_LEN: usize = 53usize;
9575 fn deser(
9576 _version: MavlinkVersion,
9577 __input: &[u8],
9578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9579 let avail_len = __input.len();
9580 let mut payload_buf = [0; Self::ENCODED_LEN];
9581 let mut buf = if avail_len < Self::ENCODED_LEN {
9582 payload_buf[0..avail_len].copy_from_slice(__input);
9583 Bytes::new(&payload_buf)
9584 } else {
9585 Bytes::new(__input)
9586 };
9587 let mut __struct = Self::default();
9588 __struct.time_boot_ms = buf.get_u32_le();
9589 __struct.lat_camera = buf.get_i32_le();
9590 __struct.lon_camera = buf.get_i32_le();
9591 __struct.alt_camera = buf.get_i32_le();
9592 __struct.lat_image = buf.get_i32_le();
9593 __struct.lon_image = buf.get_i32_le();
9594 __struct.alt_image = buf.get_i32_le();
9595 for v in &mut __struct.q {
9596 let val = buf.get_f32_le();
9597 *v = val;
9598 }
9599 __struct.hfov = buf.get_f32_le();
9600 __struct.vfov = buf.get_f32_le();
9601 __struct.camera_device_id = buf.get_u8();
9602 Ok(__struct)
9603 }
9604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9605 let mut __tmp = BytesMut::new(bytes);
9606 #[allow(clippy::absurd_extreme_comparisons)]
9607 #[allow(unused_comparisons)]
9608 if __tmp.remaining() < Self::ENCODED_LEN {
9609 panic!(
9610 "buffer is too small (need {} bytes, but got {})",
9611 Self::ENCODED_LEN,
9612 __tmp.remaining(),
9613 )
9614 }
9615 __tmp.put_u32_le(self.time_boot_ms);
9616 __tmp.put_i32_le(self.lat_camera);
9617 __tmp.put_i32_le(self.lon_camera);
9618 __tmp.put_i32_le(self.alt_camera);
9619 __tmp.put_i32_le(self.lat_image);
9620 __tmp.put_i32_le(self.lon_image);
9621 __tmp.put_i32_le(self.alt_image);
9622 for val in &self.q {
9623 __tmp.put_f32_le(*val);
9624 }
9625 __tmp.put_f32_le(self.hfov);
9626 __tmp.put_f32_le(self.vfov);
9627 __tmp.put_u8(self.camera_device_id);
9628 if matches!(version, MavlinkVersion::V2) {
9629 let len = __tmp.len();
9630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9631 } else {
9632 __tmp.len()
9633 }
9634 }
9635}
9636#[doc = "id: 263"]
9637#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
9638#[derive(Debug, Clone, PartialEq)]
9639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9641pub struct CAMERA_IMAGE_CAPTURED_DATA {
9642 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
9643 pub time_utc: u64,
9644 #[doc = "Timestamp (time since system boot)."]
9645 pub time_boot_ms: u32,
9646 #[doc = "Latitude where image was taken"]
9647 pub lat: i32,
9648 #[doc = "Longitude where capture was taken"]
9649 pub lon: i32,
9650 #[doc = "Altitude (MSL) where image was taken"]
9651 pub alt: i32,
9652 #[doc = "Altitude above ground"]
9653 pub relative_alt: i32,
9654 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
9655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9656 pub q: [f32; 4],
9657 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
9658 pub image_index: i32,
9659 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
9660 pub camera_id: u8,
9661 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
9662 pub capture_result: i8,
9663 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
9664 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9665 pub file_url: [u8; 205],
9666}
9667impl CAMERA_IMAGE_CAPTURED_DATA {
9668 pub const ENCODED_LEN: usize = 255usize;
9669 pub const DEFAULT: Self = Self {
9670 time_utc: 0_u64,
9671 time_boot_ms: 0_u32,
9672 lat: 0_i32,
9673 lon: 0_i32,
9674 alt: 0_i32,
9675 relative_alt: 0_i32,
9676 q: [0.0_f32; 4usize],
9677 image_index: 0_i32,
9678 camera_id: 0_u8,
9679 capture_result: 0_i8,
9680 file_url: [0_u8; 205usize],
9681 };
9682 #[cfg(feature = "arbitrary")]
9683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9684 use arbitrary::{Arbitrary, Unstructured};
9685 let mut buf = [0u8; 1024];
9686 rng.fill_bytes(&mut buf);
9687 let mut unstructured = Unstructured::new(&buf);
9688 Self::arbitrary(&mut unstructured).unwrap_or_default()
9689 }
9690}
9691impl Default for CAMERA_IMAGE_CAPTURED_DATA {
9692 fn default() -> Self {
9693 Self::DEFAULT.clone()
9694 }
9695}
9696impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
9697 type Message = MavMessage;
9698 const ID: u32 = 263u32;
9699 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
9700 const EXTRA_CRC: u8 = 133u8;
9701 const ENCODED_LEN: usize = 255usize;
9702 fn deser(
9703 _version: MavlinkVersion,
9704 __input: &[u8],
9705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9706 let avail_len = __input.len();
9707 let mut payload_buf = [0; Self::ENCODED_LEN];
9708 let mut buf = if avail_len < Self::ENCODED_LEN {
9709 payload_buf[0..avail_len].copy_from_slice(__input);
9710 Bytes::new(&payload_buf)
9711 } else {
9712 Bytes::new(__input)
9713 };
9714 let mut __struct = Self::default();
9715 __struct.time_utc = buf.get_u64_le();
9716 __struct.time_boot_ms = buf.get_u32_le();
9717 __struct.lat = buf.get_i32_le();
9718 __struct.lon = buf.get_i32_le();
9719 __struct.alt = buf.get_i32_le();
9720 __struct.relative_alt = buf.get_i32_le();
9721 for v in &mut __struct.q {
9722 let val = buf.get_f32_le();
9723 *v = val;
9724 }
9725 __struct.image_index = buf.get_i32_le();
9726 __struct.camera_id = buf.get_u8();
9727 __struct.capture_result = buf.get_i8();
9728 for v in &mut __struct.file_url {
9729 let val = buf.get_u8();
9730 *v = val;
9731 }
9732 Ok(__struct)
9733 }
9734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9735 let mut __tmp = BytesMut::new(bytes);
9736 #[allow(clippy::absurd_extreme_comparisons)]
9737 #[allow(unused_comparisons)]
9738 if __tmp.remaining() < Self::ENCODED_LEN {
9739 panic!(
9740 "buffer is too small (need {} bytes, but got {})",
9741 Self::ENCODED_LEN,
9742 __tmp.remaining(),
9743 )
9744 }
9745 __tmp.put_u64_le(self.time_utc);
9746 __tmp.put_u32_le(self.time_boot_ms);
9747 __tmp.put_i32_le(self.lat);
9748 __tmp.put_i32_le(self.lon);
9749 __tmp.put_i32_le(self.alt);
9750 __tmp.put_i32_le(self.relative_alt);
9751 for val in &self.q {
9752 __tmp.put_f32_le(*val);
9753 }
9754 __tmp.put_i32_le(self.image_index);
9755 __tmp.put_u8(self.camera_id);
9756 __tmp.put_i8(self.capture_result);
9757 for val in &self.file_url {
9758 __tmp.put_u8(*val);
9759 }
9760 if matches!(version, MavlinkVersion::V2) {
9761 let len = __tmp.len();
9762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9763 } else {
9764 __tmp.len()
9765 }
9766 }
9767}
9768#[doc = "id: 259"]
9769#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9770#[derive(Debug, Clone, PartialEq)]
9771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9773pub struct CAMERA_INFORMATION_DATA {
9774 #[doc = "Timestamp (time since system boot)."]
9775 pub time_boot_ms: u32,
9776 #[doc = "0xff). Use 0 if not known."]
9777 pub firmware_version: u32,
9778 #[doc = "Focal length. Use NaN if not known."]
9779 pub focal_length: f32,
9780 #[doc = "Image sensor size horizontal. Use NaN if not known."]
9781 pub sensor_size_h: f32,
9782 #[doc = "Image sensor size vertical. Use NaN if not known."]
9783 pub sensor_size_v: f32,
9784 #[doc = "Bitmap of camera capability flags."]
9785 pub flags: CameraCapFlags,
9786 #[doc = "Horizontal image resolution. Use 0 if not known."]
9787 pub resolution_h: u16,
9788 #[doc = "Vertical image resolution. Use 0 if not known."]
9789 pub resolution_v: u16,
9790 #[doc = "Camera definition version (iteration). Use 0 if not known."]
9791 pub cam_definition_version: u16,
9792 #[doc = "Name of the camera vendor"]
9793 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9794 pub vendor_name: [u8; 32],
9795 #[doc = "Name of the camera model"]
9796 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9797 pub model_name: [u8; 32],
9798 #[doc = "Reserved for a lens ID. Use 0 if not known."]
9799 pub lens_id: u8,
9800 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
9801 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9802 pub cam_definition_uri: [u8; 140],
9803 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
9804 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9805 pub gimbal_device_id: u8,
9806 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9808 pub camera_device_id: u8,
9809}
9810impl CAMERA_INFORMATION_DATA {
9811 pub const ENCODED_LEN: usize = 237usize;
9812 pub const DEFAULT: Self = Self {
9813 time_boot_ms: 0_u32,
9814 firmware_version: 0_u32,
9815 focal_length: 0.0_f32,
9816 sensor_size_h: 0.0_f32,
9817 sensor_size_v: 0.0_f32,
9818 flags: CameraCapFlags::DEFAULT,
9819 resolution_h: 0_u16,
9820 resolution_v: 0_u16,
9821 cam_definition_version: 0_u16,
9822 vendor_name: [0_u8; 32usize],
9823 model_name: [0_u8; 32usize],
9824 lens_id: 0_u8,
9825 cam_definition_uri: [0_u8; 140usize],
9826 gimbal_device_id: 0_u8,
9827 camera_device_id: 0_u8,
9828 };
9829 #[cfg(feature = "arbitrary")]
9830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9831 use arbitrary::{Arbitrary, Unstructured};
9832 let mut buf = [0u8; 1024];
9833 rng.fill_bytes(&mut buf);
9834 let mut unstructured = Unstructured::new(&buf);
9835 Self::arbitrary(&mut unstructured).unwrap_or_default()
9836 }
9837}
9838impl Default for CAMERA_INFORMATION_DATA {
9839 fn default() -> Self {
9840 Self::DEFAULT.clone()
9841 }
9842}
9843impl MessageData for CAMERA_INFORMATION_DATA {
9844 type Message = MavMessage;
9845 const ID: u32 = 259u32;
9846 const NAME: &'static str = "CAMERA_INFORMATION";
9847 const EXTRA_CRC: u8 = 92u8;
9848 const ENCODED_LEN: usize = 237usize;
9849 fn deser(
9850 _version: MavlinkVersion,
9851 __input: &[u8],
9852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9853 let avail_len = __input.len();
9854 let mut payload_buf = [0; Self::ENCODED_LEN];
9855 let mut buf = if avail_len < Self::ENCODED_LEN {
9856 payload_buf[0..avail_len].copy_from_slice(__input);
9857 Bytes::new(&payload_buf)
9858 } else {
9859 Bytes::new(__input)
9860 };
9861 let mut __struct = Self::default();
9862 __struct.time_boot_ms = buf.get_u32_le();
9863 __struct.firmware_version = buf.get_u32_le();
9864 __struct.focal_length = buf.get_f32_le();
9865 __struct.sensor_size_h = buf.get_f32_le();
9866 __struct.sensor_size_v = buf.get_f32_le();
9867 let tmp = buf.get_u32_le();
9868 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
9869 ::mavlink_core::error::ParserError::InvalidFlag {
9870 flag_type: "CameraCapFlags",
9871 value: tmp as u32,
9872 },
9873 )?;
9874 __struct.resolution_h = buf.get_u16_le();
9875 __struct.resolution_v = buf.get_u16_le();
9876 __struct.cam_definition_version = buf.get_u16_le();
9877 for v in &mut __struct.vendor_name {
9878 let val = buf.get_u8();
9879 *v = val;
9880 }
9881 for v in &mut __struct.model_name {
9882 let val = buf.get_u8();
9883 *v = val;
9884 }
9885 __struct.lens_id = buf.get_u8();
9886 for v in &mut __struct.cam_definition_uri {
9887 let val = buf.get_u8();
9888 *v = val;
9889 }
9890 __struct.gimbal_device_id = buf.get_u8();
9891 __struct.camera_device_id = buf.get_u8();
9892 Ok(__struct)
9893 }
9894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9895 let mut __tmp = BytesMut::new(bytes);
9896 #[allow(clippy::absurd_extreme_comparisons)]
9897 #[allow(unused_comparisons)]
9898 if __tmp.remaining() < Self::ENCODED_LEN {
9899 panic!(
9900 "buffer is too small (need {} bytes, but got {})",
9901 Self::ENCODED_LEN,
9902 __tmp.remaining(),
9903 )
9904 }
9905 __tmp.put_u32_le(self.time_boot_ms);
9906 __tmp.put_u32_le(self.firmware_version);
9907 __tmp.put_f32_le(self.focal_length);
9908 __tmp.put_f32_le(self.sensor_size_h);
9909 __tmp.put_f32_le(self.sensor_size_v);
9910 __tmp.put_u32_le(self.flags.bits());
9911 __tmp.put_u16_le(self.resolution_h);
9912 __tmp.put_u16_le(self.resolution_v);
9913 __tmp.put_u16_le(self.cam_definition_version);
9914 for val in &self.vendor_name {
9915 __tmp.put_u8(*val);
9916 }
9917 for val in &self.model_name {
9918 __tmp.put_u8(*val);
9919 }
9920 __tmp.put_u8(self.lens_id);
9921 for val in &self.cam_definition_uri {
9922 __tmp.put_u8(*val);
9923 }
9924 __tmp.put_u8(self.gimbal_device_id);
9925 __tmp.put_u8(self.camera_device_id);
9926 if matches!(version, MavlinkVersion::V2) {
9927 let len = __tmp.len();
9928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9929 } else {
9930 __tmp.len()
9931 }
9932 }
9933}
9934#[doc = "id: 260"]
9935#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
9936#[derive(Debug, Clone, PartialEq)]
9937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9939pub struct CAMERA_SETTINGS_DATA {
9940 #[doc = "Timestamp (time since system boot)."]
9941 pub time_boot_ms: u32,
9942 #[doc = "Camera mode"]
9943 pub mode_id: CameraMode,
9944 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
9945 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9946 pub zoomLevel: f32,
9947 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
9948 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9949 pub focusLevel: f32,
9950 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
9951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9952 pub camera_device_id: u8,
9953}
9954impl CAMERA_SETTINGS_DATA {
9955 pub const ENCODED_LEN: usize = 14usize;
9956 pub const DEFAULT: Self = Self {
9957 time_boot_ms: 0_u32,
9958 mode_id: CameraMode::DEFAULT,
9959 zoomLevel: 0.0_f32,
9960 focusLevel: 0.0_f32,
9961 camera_device_id: 0_u8,
9962 };
9963 #[cfg(feature = "arbitrary")]
9964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9965 use arbitrary::{Arbitrary, Unstructured};
9966 let mut buf = [0u8; 1024];
9967 rng.fill_bytes(&mut buf);
9968 let mut unstructured = Unstructured::new(&buf);
9969 Self::arbitrary(&mut unstructured).unwrap_or_default()
9970 }
9971}
9972impl Default for CAMERA_SETTINGS_DATA {
9973 fn default() -> Self {
9974 Self::DEFAULT.clone()
9975 }
9976}
9977impl MessageData for CAMERA_SETTINGS_DATA {
9978 type Message = MavMessage;
9979 const ID: u32 = 260u32;
9980 const NAME: &'static str = "CAMERA_SETTINGS";
9981 const EXTRA_CRC: u8 = 146u8;
9982 const ENCODED_LEN: usize = 14usize;
9983 fn deser(
9984 _version: MavlinkVersion,
9985 __input: &[u8],
9986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9987 let avail_len = __input.len();
9988 let mut payload_buf = [0; Self::ENCODED_LEN];
9989 let mut buf = if avail_len < Self::ENCODED_LEN {
9990 payload_buf[0..avail_len].copy_from_slice(__input);
9991 Bytes::new(&payload_buf)
9992 } else {
9993 Bytes::new(__input)
9994 };
9995 let mut __struct = Self::default();
9996 __struct.time_boot_ms = buf.get_u32_le();
9997 let tmp = buf.get_u8();
9998 __struct.mode_id =
9999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10000 enum_type: "CameraMode",
10001 value: tmp as u32,
10002 })?;
10003 __struct.zoomLevel = buf.get_f32_le();
10004 __struct.focusLevel = buf.get_f32_le();
10005 __struct.camera_device_id = buf.get_u8();
10006 Ok(__struct)
10007 }
10008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10009 let mut __tmp = BytesMut::new(bytes);
10010 #[allow(clippy::absurd_extreme_comparisons)]
10011 #[allow(unused_comparisons)]
10012 if __tmp.remaining() < Self::ENCODED_LEN {
10013 panic!(
10014 "buffer is too small (need {} bytes, but got {})",
10015 Self::ENCODED_LEN,
10016 __tmp.remaining(),
10017 )
10018 }
10019 __tmp.put_u32_le(self.time_boot_ms);
10020 __tmp.put_u8(self.mode_id as u8);
10021 __tmp.put_f32_le(self.zoomLevel);
10022 __tmp.put_f32_le(self.focusLevel);
10023 __tmp.put_u8(self.camera_device_id);
10024 if matches!(version, MavlinkVersion::V2) {
10025 let len = __tmp.len();
10026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10027 } else {
10028 __tmp.len()
10029 }
10030 }
10031}
10032#[doc = "id: 179"]
10033#[doc = "Camera Event."]
10034#[derive(Debug, Clone, PartialEq)]
10035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10037pub struct CAMERA_STATUS_DATA {
10038 #[doc = "Image timestamp (since UNIX epoch, according to camera clock)."]
10039 pub time_usec: u64,
10040 #[doc = "Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum)."]
10041 pub p1: f32,
10042 #[doc = "Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum)."]
10043 pub p2: f32,
10044 #[doc = "Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum)."]
10045 pub p3: f32,
10046 #[doc = "Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum)."]
10047 pub p4: f32,
10048 #[doc = "Image index."]
10049 pub img_idx: u16,
10050 #[doc = "System ID."]
10051 pub target_system: u8,
10052 #[doc = "Camera ID."]
10053 pub cam_idx: u8,
10054 #[doc = "Event type."]
10055 pub event_id: CameraStatusTypes,
10056}
10057impl CAMERA_STATUS_DATA {
10058 pub const ENCODED_LEN: usize = 29usize;
10059 pub const DEFAULT: Self = Self {
10060 time_usec: 0_u64,
10061 p1: 0.0_f32,
10062 p2: 0.0_f32,
10063 p3: 0.0_f32,
10064 p4: 0.0_f32,
10065 img_idx: 0_u16,
10066 target_system: 0_u8,
10067 cam_idx: 0_u8,
10068 event_id: CameraStatusTypes::DEFAULT,
10069 };
10070 #[cfg(feature = "arbitrary")]
10071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10072 use arbitrary::{Arbitrary, Unstructured};
10073 let mut buf = [0u8; 1024];
10074 rng.fill_bytes(&mut buf);
10075 let mut unstructured = Unstructured::new(&buf);
10076 Self::arbitrary(&mut unstructured).unwrap_or_default()
10077 }
10078}
10079impl Default for CAMERA_STATUS_DATA {
10080 fn default() -> Self {
10081 Self::DEFAULT.clone()
10082 }
10083}
10084impl MessageData for CAMERA_STATUS_DATA {
10085 type Message = MavMessage;
10086 const ID: u32 = 179u32;
10087 const NAME: &'static str = "CAMERA_STATUS";
10088 const EXTRA_CRC: u8 = 189u8;
10089 const ENCODED_LEN: usize = 29usize;
10090 fn deser(
10091 _version: MavlinkVersion,
10092 __input: &[u8],
10093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10094 let avail_len = __input.len();
10095 let mut payload_buf = [0; Self::ENCODED_LEN];
10096 let mut buf = if avail_len < Self::ENCODED_LEN {
10097 payload_buf[0..avail_len].copy_from_slice(__input);
10098 Bytes::new(&payload_buf)
10099 } else {
10100 Bytes::new(__input)
10101 };
10102 let mut __struct = Self::default();
10103 __struct.time_usec = buf.get_u64_le();
10104 __struct.p1 = buf.get_f32_le();
10105 __struct.p2 = buf.get_f32_le();
10106 __struct.p3 = buf.get_f32_le();
10107 __struct.p4 = buf.get_f32_le();
10108 __struct.img_idx = buf.get_u16_le();
10109 __struct.target_system = buf.get_u8();
10110 __struct.cam_idx = buf.get_u8();
10111 let tmp = buf.get_u8();
10112 __struct.event_id =
10113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10114 enum_type: "CameraStatusTypes",
10115 value: tmp as u32,
10116 })?;
10117 Ok(__struct)
10118 }
10119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10120 let mut __tmp = BytesMut::new(bytes);
10121 #[allow(clippy::absurd_extreme_comparisons)]
10122 #[allow(unused_comparisons)]
10123 if __tmp.remaining() < Self::ENCODED_LEN {
10124 panic!(
10125 "buffer is too small (need {} bytes, but got {})",
10126 Self::ENCODED_LEN,
10127 __tmp.remaining(),
10128 )
10129 }
10130 __tmp.put_u64_le(self.time_usec);
10131 __tmp.put_f32_le(self.p1);
10132 __tmp.put_f32_le(self.p2);
10133 __tmp.put_f32_le(self.p3);
10134 __tmp.put_f32_le(self.p4);
10135 __tmp.put_u16_le(self.img_idx);
10136 __tmp.put_u8(self.target_system);
10137 __tmp.put_u8(self.cam_idx);
10138 __tmp.put_u8(self.event_id as u8);
10139 if matches!(version, MavlinkVersion::V2) {
10140 let len = __tmp.len();
10141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10142 } else {
10143 __tmp.len()
10144 }
10145 }
10146}
10147#[doc = "id: 277"]
10148#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
10149#[derive(Debug, Clone, PartialEq)]
10150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10152pub struct CAMERA_THERMAL_RANGE_DATA {
10153 #[doc = "Timestamp (time since system boot)."]
10154 pub time_boot_ms: u32,
10155 #[doc = "Temperature max."]
10156 pub max: f32,
10157 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
10158 pub max_point_x: f32,
10159 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
10160 pub max_point_y: f32,
10161 #[doc = "Temperature min."]
10162 pub min: f32,
10163 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
10164 pub min_point_x: f32,
10165 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
10166 pub min_point_y: f32,
10167 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
10168 pub stream_id: u8,
10169 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
10170 pub camera_device_id: u8,
10171}
10172impl CAMERA_THERMAL_RANGE_DATA {
10173 pub const ENCODED_LEN: usize = 30usize;
10174 pub const DEFAULT: Self = Self {
10175 time_boot_ms: 0_u32,
10176 max: 0.0_f32,
10177 max_point_x: 0.0_f32,
10178 max_point_y: 0.0_f32,
10179 min: 0.0_f32,
10180 min_point_x: 0.0_f32,
10181 min_point_y: 0.0_f32,
10182 stream_id: 0_u8,
10183 camera_device_id: 0_u8,
10184 };
10185 #[cfg(feature = "arbitrary")]
10186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10187 use arbitrary::{Arbitrary, Unstructured};
10188 let mut buf = [0u8; 1024];
10189 rng.fill_bytes(&mut buf);
10190 let mut unstructured = Unstructured::new(&buf);
10191 Self::arbitrary(&mut unstructured).unwrap_or_default()
10192 }
10193}
10194impl Default for CAMERA_THERMAL_RANGE_DATA {
10195 fn default() -> Self {
10196 Self::DEFAULT.clone()
10197 }
10198}
10199impl MessageData for CAMERA_THERMAL_RANGE_DATA {
10200 type Message = MavMessage;
10201 const ID: u32 = 277u32;
10202 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
10203 const EXTRA_CRC: u8 = 62u8;
10204 const ENCODED_LEN: usize = 30usize;
10205 fn deser(
10206 _version: MavlinkVersion,
10207 __input: &[u8],
10208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10209 let avail_len = __input.len();
10210 let mut payload_buf = [0; Self::ENCODED_LEN];
10211 let mut buf = if avail_len < Self::ENCODED_LEN {
10212 payload_buf[0..avail_len].copy_from_slice(__input);
10213 Bytes::new(&payload_buf)
10214 } else {
10215 Bytes::new(__input)
10216 };
10217 let mut __struct = Self::default();
10218 __struct.time_boot_ms = buf.get_u32_le();
10219 __struct.max = buf.get_f32_le();
10220 __struct.max_point_x = buf.get_f32_le();
10221 __struct.max_point_y = buf.get_f32_le();
10222 __struct.min = buf.get_f32_le();
10223 __struct.min_point_x = buf.get_f32_le();
10224 __struct.min_point_y = buf.get_f32_le();
10225 __struct.stream_id = buf.get_u8();
10226 __struct.camera_device_id = buf.get_u8();
10227 Ok(__struct)
10228 }
10229 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10230 let mut __tmp = BytesMut::new(bytes);
10231 #[allow(clippy::absurd_extreme_comparisons)]
10232 #[allow(unused_comparisons)]
10233 if __tmp.remaining() < Self::ENCODED_LEN {
10234 panic!(
10235 "buffer is too small (need {} bytes, but got {})",
10236 Self::ENCODED_LEN,
10237 __tmp.remaining(),
10238 )
10239 }
10240 __tmp.put_u32_le(self.time_boot_ms);
10241 __tmp.put_f32_le(self.max);
10242 __tmp.put_f32_le(self.max_point_x);
10243 __tmp.put_f32_le(self.max_point_y);
10244 __tmp.put_f32_le(self.min);
10245 __tmp.put_f32_le(self.min_point_x);
10246 __tmp.put_f32_le(self.min_point_y);
10247 __tmp.put_u8(self.stream_id);
10248 __tmp.put_u8(self.camera_device_id);
10249 if matches!(version, MavlinkVersion::V2) {
10250 let len = __tmp.len();
10251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10252 } else {
10253 __tmp.len()
10254 }
10255 }
10256}
10257#[doc = "id: 276"]
10258#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
10259#[derive(Debug, Clone, PartialEq)]
10260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10262pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
10263 #[doc = "Latitude of tracked object"]
10264 pub lat: i32,
10265 #[doc = "Longitude of tracked object"]
10266 pub lon: i32,
10267 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
10268 pub alt: f32,
10269 #[doc = "Horizontal accuracy. NAN if unknown"]
10270 pub h_acc: f32,
10271 #[doc = "Vertical accuracy. NAN if unknown"]
10272 pub v_acc: f32,
10273 #[doc = "North velocity of tracked object. NAN if unknown"]
10274 pub vel_n: f32,
10275 #[doc = "East velocity of tracked object. NAN if unknown"]
10276 pub vel_e: f32,
10277 #[doc = "Down velocity of tracked object. NAN if unknown"]
10278 pub vel_d: f32,
10279 #[doc = "Velocity accuracy. NAN if unknown"]
10280 pub vel_acc: f32,
10281 #[doc = "Distance between camera and tracked object. NAN if unknown"]
10282 pub dist: f32,
10283 #[doc = "Heading in radians, in NED. NAN if unknown"]
10284 pub hdg: f32,
10285 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
10286 pub hdg_acc: f32,
10287 #[doc = "Current tracking status"]
10288 pub tracking_status: CameraTrackingStatusFlags,
10289 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
10290 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10291 pub camera_device_id: u8,
10292}
10293impl CAMERA_TRACKING_GEO_STATUS_DATA {
10294 pub const ENCODED_LEN: usize = 50usize;
10295 pub const DEFAULT: Self = Self {
10296 lat: 0_i32,
10297 lon: 0_i32,
10298 alt: 0.0_f32,
10299 h_acc: 0.0_f32,
10300 v_acc: 0.0_f32,
10301 vel_n: 0.0_f32,
10302 vel_e: 0.0_f32,
10303 vel_d: 0.0_f32,
10304 vel_acc: 0.0_f32,
10305 dist: 0.0_f32,
10306 hdg: 0.0_f32,
10307 hdg_acc: 0.0_f32,
10308 tracking_status: CameraTrackingStatusFlags::DEFAULT,
10309 camera_device_id: 0_u8,
10310 };
10311 #[cfg(feature = "arbitrary")]
10312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10313 use arbitrary::{Arbitrary, Unstructured};
10314 let mut buf = [0u8; 1024];
10315 rng.fill_bytes(&mut buf);
10316 let mut unstructured = Unstructured::new(&buf);
10317 Self::arbitrary(&mut unstructured).unwrap_or_default()
10318 }
10319}
10320impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
10321 fn default() -> Self {
10322 Self::DEFAULT.clone()
10323 }
10324}
10325impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
10326 type Message = MavMessage;
10327 const ID: u32 = 276u32;
10328 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
10329 const EXTRA_CRC: u8 = 18u8;
10330 const ENCODED_LEN: usize = 50usize;
10331 fn deser(
10332 _version: MavlinkVersion,
10333 __input: &[u8],
10334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10335 let avail_len = __input.len();
10336 let mut payload_buf = [0; Self::ENCODED_LEN];
10337 let mut buf = if avail_len < Self::ENCODED_LEN {
10338 payload_buf[0..avail_len].copy_from_slice(__input);
10339 Bytes::new(&payload_buf)
10340 } else {
10341 Bytes::new(__input)
10342 };
10343 let mut __struct = Self::default();
10344 __struct.lat = buf.get_i32_le();
10345 __struct.lon = buf.get_i32_le();
10346 __struct.alt = buf.get_f32_le();
10347 __struct.h_acc = buf.get_f32_le();
10348 __struct.v_acc = buf.get_f32_le();
10349 __struct.vel_n = buf.get_f32_le();
10350 __struct.vel_e = buf.get_f32_le();
10351 __struct.vel_d = buf.get_f32_le();
10352 __struct.vel_acc = buf.get_f32_le();
10353 __struct.dist = buf.get_f32_le();
10354 __struct.hdg = buf.get_f32_le();
10355 __struct.hdg_acc = buf.get_f32_le();
10356 let tmp = buf.get_u8();
10357 __struct.tracking_status =
10358 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10359 enum_type: "CameraTrackingStatusFlags",
10360 value: tmp as u32,
10361 })?;
10362 __struct.camera_device_id = buf.get_u8();
10363 Ok(__struct)
10364 }
10365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10366 let mut __tmp = BytesMut::new(bytes);
10367 #[allow(clippy::absurd_extreme_comparisons)]
10368 #[allow(unused_comparisons)]
10369 if __tmp.remaining() < Self::ENCODED_LEN {
10370 panic!(
10371 "buffer is too small (need {} bytes, but got {})",
10372 Self::ENCODED_LEN,
10373 __tmp.remaining(),
10374 )
10375 }
10376 __tmp.put_i32_le(self.lat);
10377 __tmp.put_i32_le(self.lon);
10378 __tmp.put_f32_le(self.alt);
10379 __tmp.put_f32_le(self.h_acc);
10380 __tmp.put_f32_le(self.v_acc);
10381 __tmp.put_f32_le(self.vel_n);
10382 __tmp.put_f32_le(self.vel_e);
10383 __tmp.put_f32_le(self.vel_d);
10384 __tmp.put_f32_le(self.vel_acc);
10385 __tmp.put_f32_le(self.dist);
10386 __tmp.put_f32_le(self.hdg);
10387 __tmp.put_f32_le(self.hdg_acc);
10388 __tmp.put_u8(self.tracking_status as u8);
10389 __tmp.put_u8(self.camera_device_id);
10390 if matches!(version, MavlinkVersion::V2) {
10391 let len = __tmp.len();
10392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10393 } else {
10394 __tmp.len()
10395 }
10396 }
10397}
10398#[doc = "id: 275"]
10399#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
10400#[derive(Debug, Clone, PartialEq)]
10401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10403pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
10404 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
10405 pub point_x: f32,
10406 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
10407 pub point_y: f32,
10408 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
10409 pub radius: f32,
10410 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
10411 pub rec_top_x: f32,
10412 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
10413 pub rec_top_y: f32,
10414 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
10415 pub rec_bottom_x: f32,
10416 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
10417 pub rec_bottom_y: f32,
10418 #[doc = "Current tracking status"]
10419 pub tracking_status: CameraTrackingStatusFlags,
10420 #[doc = "Current tracking mode"]
10421 pub tracking_mode: CameraTrackingMode,
10422 #[doc = "Defines location of target data"]
10423 pub target_data: CameraTrackingTargetData,
10424 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
10425 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10426 pub camera_device_id: u8,
10427}
10428impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
10429 pub const ENCODED_LEN: usize = 32usize;
10430 pub const DEFAULT: Self = Self {
10431 point_x: 0.0_f32,
10432 point_y: 0.0_f32,
10433 radius: 0.0_f32,
10434 rec_top_x: 0.0_f32,
10435 rec_top_y: 0.0_f32,
10436 rec_bottom_x: 0.0_f32,
10437 rec_bottom_y: 0.0_f32,
10438 tracking_status: CameraTrackingStatusFlags::DEFAULT,
10439 tracking_mode: CameraTrackingMode::DEFAULT,
10440 target_data: CameraTrackingTargetData::DEFAULT,
10441 camera_device_id: 0_u8,
10442 };
10443 #[cfg(feature = "arbitrary")]
10444 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10445 use arbitrary::{Arbitrary, Unstructured};
10446 let mut buf = [0u8; 1024];
10447 rng.fill_bytes(&mut buf);
10448 let mut unstructured = Unstructured::new(&buf);
10449 Self::arbitrary(&mut unstructured).unwrap_or_default()
10450 }
10451}
10452impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
10453 fn default() -> Self {
10454 Self::DEFAULT.clone()
10455 }
10456}
10457impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
10458 type Message = MavMessage;
10459 const ID: u32 = 275u32;
10460 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
10461 const EXTRA_CRC: u8 = 126u8;
10462 const ENCODED_LEN: usize = 32usize;
10463 fn deser(
10464 _version: MavlinkVersion,
10465 __input: &[u8],
10466 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10467 let avail_len = __input.len();
10468 let mut payload_buf = [0; Self::ENCODED_LEN];
10469 let mut buf = if avail_len < Self::ENCODED_LEN {
10470 payload_buf[0..avail_len].copy_from_slice(__input);
10471 Bytes::new(&payload_buf)
10472 } else {
10473 Bytes::new(__input)
10474 };
10475 let mut __struct = Self::default();
10476 __struct.point_x = buf.get_f32_le();
10477 __struct.point_y = buf.get_f32_le();
10478 __struct.radius = buf.get_f32_le();
10479 __struct.rec_top_x = buf.get_f32_le();
10480 __struct.rec_top_y = buf.get_f32_le();
10481 __struct.rec_bottom_x = buf.get_f32_le();
10482 __struct.rec_bottom_y = buf.get_f32_le();
10483 let tmp = buf.get_u8();
10484 __struct.tracking_status =
10485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10486 enum_type: "CameraTrackingStatusFlags",
10487 value: tmp as u32,
10488 })?;
10489 let tmp = buf.get_u8();
10490 __struct.tracking_mode =
10491 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10492 enum_type: "CameraTrackingMode",
10493 value: tmp as u32,
10494 })?;
10495 let tmp = buf.get_u8();
10496 __struct.target_data =
10497 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
10498 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10499 flag_type: "CameraTrackingTargetData",
10500 value: tmp as u32,
10501 })?;
10502 __struct.camera_device_id = buf.get_u8();
10503 Ok(__struct)
10504 }
10505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10506 let mut __tmp = BytesMut::new(bytes);
10507 #[allow(clippy::absurd_extreme_comparisons)]
10508 #[allow(unused_comparisons)]
10509 if __tmp.remaining() < Self::ENCODED_LEN {
10510 panic!(
10511 "buffer is too small (need {} bytes, but got {})",
10512 Self::ENCODED_LEN,
10513 __tmp.remaining(),
10514 )
10515 }
10516 __tmp.put_f32_le(self.point_x);
10517 __tmp.put_f32_le(self.point_y);
10518 __tmp.put_f32_le(self.radius);
10519 __tmp.put_f32_le(self.rec_top_x);
10520 __tmp.put_f32_le(self.rec_top_y);
10521 __tmp.put_f32_le(self.rec_bottom_x);
10522 __tmp.put_f32_le(self.rec_bottom_y);
10523 __tmp.put_u8(self.tracking_status as u8);
10524 __tmp.put_u8(self.tracking_mode as u8);
10525 __tmp.put_u8(self.target_data.bits());
10526 __tmp.put_u8(self.camera_device_id);
10527 if matches!(version, MavlinkVersion::V2) {
10528 let len = __tmp.len();
10529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10530 } else {
10531 __tmp.len()
10532 }
10533 }
10534}
10535#[doc = "id: 112"]
10536#[doc = "Camera-IMU triggering and synchronisation message."]
10537#[derive(Debug, Clone, PartialEq)]
10538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10540pub struct CAMERA_TRIGGER_DATA {
10541 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10542 pub time_usec: u64,
10543 #[doc = "Image frame sequence"]
10544 pub seq: u32,
10545}
10546impl CAMERA_TRIGGER_DATA {
10547 pub const ENCODED_LEN: usize = 12usize;
10548 pub const DEFAULT: Self = Self {
10549 time_usec: 0_u64,
10550 seq: 0_u32,
10551 };
10552 #[cfg(feature = "arbitrary")]
10553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10554 use arbitrary::{Arbitrary, Unstructured};
10555 let mut buf = [0u8; 1024];
10556 rng.fill_bytes(&mut buf);
10557 let mut unstructured = Unstructured::new(&buf);
10558 Self::arbitrary(&mut unstructured).unwrap_or_default()
10559 }
10560}
10561impl Default for CAMERA_TRIGGER_DATA {
10562 fn default() -> Self {
10563 Self::DEFAULT.clone()
10564 }
10565}
10566impl MessageData for CAMERA_TRIGGER_DATA {
10567 type Message = MavMessage;
10568 const ID: u32 = 112u32;
10569 const NAME: &'static str = "CAMERA_TRIGGER";
10570 const EXTRA_CRC: u8 = 174u8;
10571 const ENCODED_LEN: usize = 12usize;
10572 fn deser(
10573 _version: MavlinkVersion,
10574 __input: &[u8],
10575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10576 let avail_len = __input.len();
10577 let mut payload_buf = [0; Self::ENCODED_LEN];
10578 let mut buf = if avail_len < Self::ENCODED_LEN {
10579 payload_buf[0..avail_len].copy_from_slice(__input);
10580 Bytes::new(&payload_buf)
10581 } else {
10582 Bytes::new(__input)
10583 };
10584 let mut __struct = Self::default();
10585 __struct.time_usec = buf.get_u64_le();
10586 __struct.seq = buf.get_u32_le();
10587 Ok(__struct)
10588 }
10589 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10590 let mut __tmp = BytesMut::new(bytes);
10591 #[allow(clippy::absurd_extreme_comparisons)]
10592 #[allow(unused_comparisons)]
10593 if __tmp.remaining() < Self::ENCODED_LEN {
10594 panic!(
10595 "buffer is too small (need {} bytes, but got {})",
10596 Self::ENCODED_LEN,
10597 __tmp.remaining(),
10598 )
10599 }
10600 __tmp.put_u64_le(self.time_usec);
10601 __tmp.put_u32_le(self.seq);
10602 if matches!(version, MavlinkVersion::V2) {
10603 let len = __tmp.len();
10604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10605 } else {
10606 __tmp.len()
10607 }
10608 }
10609}
10610#[doc = "id: 387"]
10611#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
10612#[derive(Debug, Clone, PartialEq)]
10613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10615pub struct CANFD_FRAME_DATA {
10616 #[doc = "Frame ID"]
10617 pub id: u32,
10618 #[doc = "System ID."]
10619 pub target_system: u8,
10620 #[doc = "Component ID."]
10621 pub target_component: u8,
10622 #[doc = "bus number"]
10623 pub bus: u8,
10624 #[doc = "Frame length"]
10625 pub len: u8,
10626 #[doc = "Frame data"]
10627 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10628 pub data: [u8; 64],
10629}
10630impl CANFD_FRAME_DATA {
10631 pub const ENCODED_LEN: usize = 72usize;
10632 pub const DEFAULT: Self = Self {
10633 id: 0_u32,
10634 target_system: 0_u8,
10635 target_component: 0_u8,
10636 bus: 0_u8,
10637 len: 0_u8,
10638 data: [0_u8; 64usize],
10639 };
10640 #[cfg(feature = "arbitrary")]
10641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10642 use arbitrary::{Arbitrary, Unstructured};
10643 let mut buf = [0u8; 1024];
10644 rng.fill_bytes(&mut buf);
10645 let mut unstructured = Unstructured::new(&buf);
10646 Self::arbitrary(&mut unstructured).unwrap_or_default()
10647 }
10648}
10649impl Default for CANFD_FRAME_DATA {
10650 fn default() -> Self {
10651 Self::DEFAULT.clone()
10652 }
10653}
10654impl MessageData for CANFD_FRAME_DATA {
10655 type Message = MavMessage;
10656 const ID: u32 = 387u32;
10657 const NAME: &'static str = "CANFD_FRAME";
10658 const EXTRA_CRC: u8 = 4u8;
10659 const ENCODED_LEN: usize = 72usize;
10660 fn deser(
10661 _version: MavlinkVersion,
10662 __input: &[u8],
10663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10664 let avail_len = __input.len();
10665 let mut payload_buf = [0; Self::ENCODED_LEN];
10666 let mut buf = if avail_len < Self::ENCODED_LEN {
10667 payload_buf[0..avail_len].copy_from_slice(__input);
10668 Bytes::new(&payload_buf)
10669 } else {
10670 Bytes::new(__input)
10671 };
10672 let mut __struct = Self::default();
10673 __struct.id = buf.get_u32_le();
10674 __struct.target_system = buf.get_u8();
10675 __struct.target_component = buf.get_u8();
10676 __struct.bus = buf.get_u8();
10677 __struct.len = buf.get_u8();
10678 for v in &mut __struct.data {
10679 let val = buf.get_u8();
10680 *v = val;
10681 }
10682 Ok(__struct)
10683 }
10684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10685 let mut __tmp = BytesMut::new(bytes);
10686 #[allow(clippy::absurd_extreme_comparisons)]
10687 #[allow(unused_comparisons)]
10688 if __tmp.remaining() < Self::ENCODED_LEN {
10689 panic!(
10690 "buffer is too small (need {} bytes, but got {})",
10691 Self::ENCODED_LEN,
10692 __tmp.remaining(),
10693 )
10694 }
10695 __tmp.put_u32_le(self.id);
10696 __tmp.put_u8(self.target_system);
10697 __tmp.put_u8(self.target_component);
10698 __tmp.put_u8(self.bus);
10699 __tmp.put_u8(self.len);
10700 for val in &self.data {
10701 __tmp.put_u8(*val);
10702 }
10703 if matches!(version, MavlinkVersion::V2) {
10704 let len = __tmp.len();
10705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10706 } else {
10707 __tmp.len()
10708 }
10709 }
10710}
10711#[doc = "id: 388"]
10712#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
10713#[derive(Debug, Clone, PartialEq)]
10714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10716pub struct CAN_FILTER_MODIFY_DATA {
10717 #[doc = "filter IDs, length num_ids"]
10718 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10719 pub ids: [u16; 16],
10720 #[doc = "System ID."]
10721 pub target_system: u8,
10722 #[doc = "Component ID."]
10723 pub target_component: u8,
10724 #[doc = "bus number"]
10725 pub bus: u8,
10726 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
10727 pub operation: CanFilterOp,
10728 #[doc = "number of IDs in filter list"]
10729 pub num_ids: u8,
10730}
10731impl CAN_FILTER_MODIFY_DATA {
10732 pub const ENCODED_LEN: usize = 37usize;
10733 pub const DEFAULT: Self = Self {
10734 ids: [0_u16; 16usize],
10735 target_system: 0_u8,
10736 target_component: 0_u8,
10737 bus: 0_u8,
10738 operation: CanFilterOp::DEFAULT,
10739 num_ids: 0_u8,
10740 };
10741 #[cfg(feature = "arbitrary")]
10742 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10743 use arbitrary::{Arbitrary, Unstructured};
10744 let mut buf = [0u8; 1024];
10745 rng.fill_bytes(&mut buf);
10746 let mut unstructured = Unstructured::new(&buf);
10747 Self::arbitrary(&mut unstructured).unwrap_or_default()
10748 }
10749}
10750impl Default for CAN_FILTER_MODIFY_DATA {
10751 fn default() -> Self {
10752 Self::DEFAULT.clone()
10753 }
10754}
10755impl MessageData for CAN_FILTER_MODIFY_DATA {
10756 type Message = MavMessage;
10757 const ID: u32 = 388u32;
10758 const NAME: &'static str = "CAN_FILTER_MODIFY";
10759 const EXTRA_CRC: u8 = 8u8;
10760 const ENCODED_LEN: usize = 37usize;
10761 fn deser(
10762 _version: MavlinkVersion,
10763 __input: &[u8],
10764 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10765 let avail_len = __input.len();
10766 let mut payload_buf = [0; Self::ENCODED_LEN];
10767 let mut buf = if avail_len < Self::ENCODED_LEN {
10768 payload_buf[0..avail_len].copy_from_slice(__input);
10769 Bytes::new(&payload_buf)
10770 } else {
10771 Bytes::new(__input)
10772 };
10773 let mut __struct = Self::default();
10774 for v in &mut __struct.ids {
10775 let val = buf.get_u16_le();
10776 *v = val;
10777 }
10778 __struct.target_system = buf.get_u8();
10779 __struct.target_component = buf.get_u8();
10780 __struct.bus = buf.get_u8();
10781 let tmp = buf.get_u8();
10782 __struct.operation =
10783 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10784 enum_type: "CanFilterOp",
10785 value: tmp as u32,
10786 })?;
10787 __struct.num_ids = buf.get_u8();
10788 Ok(__struct)
10789 }
10790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10791 let mut __tmp = BytesMut::new(bytes);
10792 #[allow(clippy::absurd_extreme_comparisons)]
10793 #[allow(unused_comparisons)]
10794 if __tmp.remaining() < Self::ENCODED_LEN {
10795 panic!(
10796 "buffer is too small (need {} bytes, but got {})",
10797 Self::ENCODED_LEN,
10798 __tmp.remaining(),
10799 )
10800 }
10801 for val in &self.ids {
10802 __tmp.put_u16_le(*val);
10803 }
10804 __tmp.put_u8(self.target_system);
10805 __tmp.put_u8(self.target_component);
10806 __tmp.put_u8(self.bus);
10807 __tmp.put_u8(self.operation as u8);
10808 __tmp.put_u8(self.num_ids);
10809 if matches!(version, MavlinkVersion::V2) {
10810 let len = __tmp.len();
10811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10812 } else {
10813 __tmp.len()
10814 }
10815 }
10816}
10817#[doc = "id: 386"]
10818#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
10819#[derive(Debug, Clone, PartialEq)]
10820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10822pub struct CAN_FRAME_DATA {
10823 #[doc = "Frame ID"]
10824 pub id: u32,
10825 #[doc = "System ID."]
10826 pub target_system: u8,
10827 #[doc = "Component ID."]
10828 pub target_component: u8,
10829 #[doc = "Bus number"]
10830 pub bus: u8,
10831 #[doc = "Frame length"]
10832 pub len: u8,
10833 #[doc = "Frame data"]
10834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10835 pub data: [u8; 8],
10836}
10837impl CAN_FRAME_DATA {
10838 pub const ENCODED_LEN: usize = 16usize;
10839 pub const DEFAULT: Self = Self {
10840 id: 0_u32,
10841 target_system: 0_u8,
10842 target_component: 0_u8,
10843 bus: 0_u8,
10844 len: 0_u8,
10845 data: [0_u8; 8usize],
10846 };
10847 #[cfg(feature = "arbitrary")]
10848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10849 use arbitrary::{Arbitrary, Unstructured};
10850 let mut buf = [0u8; 1024];
10851 rng.fill_bytes(&mut buf);
10852 let mut unstructured = Unstructured::new(&buf);
10853 Self::arbitrary(&mut unstructured).unwrap_or_default()
10854 }
10855}
10856impl Default for CAN_FRAME_DATA {
10857 fn default() -> Self {
10858 Self::DEFAULT.clone()
10859 }
10860}
10861impl MessageData for CAN_FRAME_DATA {
10862 type Message = MavMessage;
10863 const ID: u32 = 386u32;
10864 const NAME: &'static str = "CAN_FRAME";
10865 const EXTRA_CRC: u8 = 132u8;
10866 const ENCODED_LEN: usize = 16usize;
10867 fn deser(
10868 _version: MavlinkVersion,
10869 __input: &[u8],
10870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10871 let avail_len = __input.len();
10872 let mut payload_buf = [0; Self::ENCODED_LEN];
10873 let mut buf = if avail_len < Self::ENCODED_LEN {
10874 payload_buf[0..avail_len].copy_from_slice(__input);
10875 Bytes::new(&payload_buf)
10876 } else {
10877 Bytes::new(__input)
10878 };
10879 let mut __struct = Self::default();
10880 __struct.id = buf.get_u32_le();
10881 __struct.target_system = buf.get_u8();
10882 __struct.target_component = buf.get_u8();
10883 __struct.bus = buf.get_u8();
10884 __struct.len = buf.get_u8();
10885 for v in &mut __struct.data {
10886 let val = buf.get_u8();
10887 *v = val;
10888 }
10889 Ok(__struct)
10890 }
10891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10892 let mut __tmp = BytesMut::new(bytes);
10893 #[allow(clippy::absurd_extreme_comparisons)]
10894 #[allow(unused_comparisons)]
10895 if __tmp.remaining() < Self::ENCODED_LEN {
10896 panic!(
10897 "buffer is too small (need {} bytes, but got {})",
10898 Self::ENCODED_LEN,
10899 __tmp.remaining(),
10900 )
10901 }
10902 __tmp.put_u32_le(self.id);
10903 __tmp.put_u8(self.target_system);
10904 __tmp.put_u8(self.target_component);
10905 __tmp.put_u8(self.bus);
10906 __tmp.put_u8(self.len);
10907 for val in &self.data {
10908 __tmp.put_u8(*val);
10909 }
10910 if matches!(version, MavlinkVersion::V2) {
10911 let len = __tmp.len();
10912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10913 } else {
10914 __tmp.len()
10915 }
10916 }
10917}
10918#[doc = "id: 336"]
10919#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
10920#[derive(Debug, Clone, PartialEq)]
10921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10923pub struct CELLULAR_CONFIG_DATA {
10924 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10925 pub enable_lte: u8,
10926 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10927 pub enable_pin: u8,
10928 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
10929 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10930 pub pin: [u8; 16],
10931 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
10932 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10933 pub new_pin: [u8; 16],
10934 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
10935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10936 pub apn: [u8; 32],
10937 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
10938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10939 pub puk: [u8; 16],
10940 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10941 pub roaming: u8,
10942 #[doc = "Message acceptance response (sent back to GS)."]
10943 pub response: CellularConfigResponse,
10944}
10945impl CELLULAR_CONFIG_DATA {
10946 pub const ENCODED_LEN: usize = 84usize;
10947 pub const DEFAULT: Self = Self {
10948 enable_lte: 0_u8,
10949 enable_pin: 0_u8,
10950 pin: [0_u8; 16usize],
10951 new_pin: [0_u8; 16usize],
10952 apn: [0_u8; 32usize],
10953 puk: [0_u8; 16usize],
10954 roaming: 0_u8,
10955 response: CellularConfigResponse::DEFAULT,
10956 };
10957 #[cfg(feature = "arbitrary")]
10958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10959 use arbitrary::{Arbitrary, Unstructured};
10960 let mut buf = [0u8; 1024];
10961 rng.fill_bytes(&mut buf);
10962 let mut unstructured = Unstructured::new(&buf);
10963 Self::arbitrary(&mut unstructured).unwrap_or_default()
10964 }
10965}
10966impl Default for CELLULAR_CONFIG_DATA {
10967 fn default() -> Self {
10968 Self::DEFAULT.clone()
10969 }
10970}
10971impl MessageData for CELLULAR_CONFIG_DATA {
10972 type Message = MavMessage;
10973 const ID: u32 = 336u32;
10974 const NAME: &'static str = "CELLULAR_CONFIG";
10975 const EXTRA_CRC: u8 = 245u8;
10976 const ENCODED_LEN: usize = 84usize;
10977 fn deser(
10978 _version: MavlinkVersion,
10979 __input: &[u8],
10980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10981 let avail_len = __input.len();
10982 let mut payload_buf = [0; Self::ENCODED_LEN];
10983 let mut buf = if avail_len < Self::ENCODED_LEN {
10984 payload_buf[0..avail_len].copy_from_slice(__input);
10985 Bytes::new(&payload_buf)
10986 } else {
10987 Bytes::new(__input)
10988 };
10989 let mut __struct = Self::default();
10990 __struct.enable_lte = buf.get_u8();
10991 __struct.enable_pin = buf.get_u8();
10992 for v in &mut __struct.pin {
10993 let val = buf.get_u8();
10994 *v = val;
10995 }
10996 for v in &mut __struct.new_pin {
10997 let val = buf.get_u8();
10998 *v = val;
10999 }
11000 for v in &mut __struct.apn {
11001 let val = buf.get_u8();
11002 *v = val;
11003 }
11004 for v in &mut __struct.puk {
11005 let val = buf.get_u8();
11006 *v = val;
11007 }
11008 __struct.roaming = buf.get_u8();
11009 let tmp = buf.get_u8();
11010 __struct.response =
11011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11012 enum_type: "CellularConfigResponse",
11013 value: tmp as u32,
11014 })?;
11015 Ok(__struct)
11016 }
11017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11018 let mut __tmp = BytesMut::new(bytes);
11019 #[allow(clippy::absurd_extreme_comparisons)]
11020 #[allow(unused_comparisons)]
11021 if __tmp.remaining() < Self::ENCODED_LEN {
11022 panic!(
11023 "buffer is too small (need {} bytes, but got {})",
11024 Self::ENCODED_LEN,
11025 __tmp.remaining(),
11026 )
11027 }
11028 __tmp.put_u8(self.enable_lte);
11029 __tmp.put_u8(self.enable_pin);
11030 for val in &self.pin {
11031 __tmp.put_u8(*val);
11032 }
11033 for val in &self.new_pin {
11034 __tmp.put_u8(*val);
11035 }
11036 for val in &self.apn {
11037 __tmp.put_u8(*val);
11038 }
11039 for val in &self.puk {
11040 __tmp.put_u8(*val);
11041 }
11042 __tmp.put_u8(self.roaming);
11043 __tmp.put_u8(self.response as u8);
11044 if matches!(version, MavlinkVersion::V2) {
11045 let len = __tmp.len();
11046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11047 } else {
11048 __tmp.len()
11049 }
11050 }
11051}
11052#[doc = "id: 334"]
11053#[doc = "Report current used cellular network status."]
11054#[derive(Debug, Clone, PartialEq)]
11055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11057pub struct CELLULAR_STATUS_DATA {
11058 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
11059 pub mcc: u16,
11060 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
11061 pub mnc: u16,
11062 #[doc = "Location area code. If unknown, set to 0"]
11063 pub lac: u16,
11064 #[doc = "Cellular modem status"]
11065 pub status: CellularStatusFlag,
11066 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
11067 pub failure_reason: CellularNetworkFailedReason,
11068 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
11069 pub mavtype: CellularNetworkRadioType,
11070 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
11071 pub quality: u8,
11072}
11073impl CELLULAR_STATUS_DATA {
11074 pub const ENCODED_LEN: usize = 10usize;
11075 pub const DEFAULT: Self = Self {
11076 mcc: 0_u16,
11077 mnc: 0_u16,
11078 lac: 0_u16,
11079 status: CellularStatusFlag::DEFAULT,
11080 failure_reason: CellularNetworkFailedReason::DEFAULT,
11081 mavtype: CellularNetworkRadioType::DEFAULT,
11082 quality: 0_u8,
11083 };
11084 #[cfg(feature = "arbitrary")]
11085 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11086 use arbitrary::{Arbitrary, Unstructured};
11087 let mut buf = [0u8; 1024];
11088 rng.fill_bytes(&mut buf);
11089 let mut unstructured = Unstructured::new(&buf);
11090 Self::arbitrary(&mut unstructured).unwrap_or_default()
11091 }
11092}
11093impl Default for CELLULAR_STATUS_DATA {
11094 fn default() -> Self {
11095 Self::DEFAULT.clone()
11096 }
11097}
11098impl MessageData for CELLULAR_STATUS_DATA {
11099 type Message = MavMessage;
11100 const ID: u32 = 334u32;
11101 const NAME: &'static str = "CELLULAR_STATUS";
11102 const EXTRA_CRC: u8 = 72u8;
11103 const ENCODED_LEN: usize = 10usize;
11104 fn deser(
11105 _version: MavlinkVersion,
11106 __input: &[u8],
11107 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11108 let avail_len = __input.len();
11109 let mut payload_buf = [0; Self::ENCODED_LEN];
11110 let mut buf = if avail_len < Self::ENCODED_LEN {
11111 payload_buf[0..avail_len].copy_from_slice(__input);
11112 Bytes::new(&payload_buf)
11113 } else {
11114 Bytes::new(__input)
11115 };
11116 let mut __struct = Self::default();
11117 __struct.mcc = buf.get_u16_le();
11118 __struct.mnc = buf.get_u16_le();
11119 __struct.lac = buf.get_u16_le();
11120 let tmp = buf.get_u8();
11121 __struct.status =
11122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11123 enum_type: "CellularStatusFlag",
11124 value: tmp as u32,
11125 })?;
11126 let tmp = buf.get_u8();
11127 __struct.failure_reason =
11128 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11129 enum_type: "CellularNetworkFailedReason",
11130 value: tmp as u32,
11131 })?;
11132 let tmp = buf.get_u8();
11133 __struct.mavtype =
11134 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11135 enum_type: "CellularNetworkRadioType",
11136 value: tmp as u32,
11137 })?;
11138 __struct.quality = buf.get_u8();
11139 Ok(__struct)
11140 }
11141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11142 let mut __tmp = BytesMut::new(bytes);
11143 #[allow(clippy::absurd_extreme_comparisons)]
11144 #[allow(unused_comparisons)]
11145 if __tmp.remaining() < Self::ENCODED_LEN {
11146 panic!(
11147 "buffer is too small (need {} bytes, but got {})",
11148 Self::ENCODED_LEN,
11149 __tmp.remaining(),
11150 )
11151 }
11152 __tmp.put_u16_le(self.mcc);
11153 __tmp.put_u16_le(self.mnc);
11154 __tmp.put_u16_le(self.lac);
11155 __tmp.put_u8(self.status as u8);
11156 __tmp.put_u8(self.failure_reason as u8);
11157 __tmp.put_u8(self.mavtype as u8);
11158 __tmp.put_u8(self.quality);
11159 if matches!(version, MavlinkVersion::V2) {
11160 let len = __tmp.len();
11161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11162 } else {
11163 __tmp.len()
11164 }
11165 }
11166}
11167#[doc = "id: 5"]
11168#[doc = "Request to control this MAV."]
11169#[derive(Debug, Clone, PartialEq)]
11170#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11172pub struct CHANGE_OPERATOR_CONTROL_DATA {
11173 #[doc = "System the GCS requests control for"]
11174 pub target_system: u8,
11175 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
11176 pub control_request: u8,
11177 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
11178 pub version: u8,
11179 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
11180 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11181 pub passkey: [u8; 25],
11182}
11183impl CHANGE_OPERATOR_CONTROL_DATA {
11184 pub const ENCODED_LEN: usize = 28usize;
11185 pub const DEFAULT: Self = Self {
11186 target_system: 0_u8,
11187 control_request: 0_u8,
11188 version: 0_u8,
11189 passkey: [0_u8; 25usize],
11190 };
11191 #[cfg(feature = "arbitrary")]
11192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11193 use arbitrary::{Arbitrary, Unstructured};
11194 let mut buf = [0u8; 1024];
11195 rng.fill_bytes(&mut buf);
11196 let mut unstructured = Unstructured::new(&buf);
11197 Self::arbitrary(&mut unstructured).unwrap_or_default()
11198 }
11199}
11200impl Default for CHANGE_OPERATOR_CONTROL_DATA {
11201 fn default() -> Self {
11202 Self::DEFAULT.clone()
11203 }
11204}
11205impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
11206 type Message = MavMessage;
11207 const ID: u32 = 5u32;
11208 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
11209 const EXTRA_CRC: u8 = 217u8;
11210 const ENCODED_LEN: usize = 28usize;
11211 fn deser(
11212 _version: MavlinkVersion,
11213 __input: &[u8],
11214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11215 let avail_len = __input.len();
11216 let mut payload_buf = [0; Self::ENCODED_LEN];
11217 let mut buf = if avail_len < Self::ENCODED_LEN {
11218 payload_buf[0..avail_len].copy_from_slice(__input);
11219 Bytes::new(&payload_buf)
11220 } else {
11221 Bytes::new(__input)
11222 };
11223 let mut __struct = Self::default();
11224 __struct.target_system = buf.get_u8();
11225 __struct.control_request = buf.get_u8();
11226 __struct.version = buf.get_u8();
11227 for v in &mut __struct.passkey {
11228 let val = buf.get_u8();
11229 *v = val;
11230 }
11231 Ok(__struct)
11232 }
11233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11234 let mut __tmp = BytesMut::new(bytes);
11235 #[allow(clippy::absurd_extreme_comparisons)]
11236 #[allow(unused_comparisons)]
11237 if __tmp.remaining() < Self::ENCODED_LEN {
11238 panic!(
11239 "buffer is too small (need {} bytes, but got {})",
11240 Self::ENCODED_LEN,
11241 __tmp.remaining(),
11242 )
11243 }
11244 __tmp.put_u8(self.target_system);
11245 __tmp.put_u8(self.control_request);
11246 __tmp.put_u8(self.version);
11247 for val in &self.passkey {
11248 __tmp.put_u8(*val);
11249 }
11250 if matches!(version, MavlinkVersion::V2) {
11251 let len = __tmp.len();
11252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11253 } else {
11254 __tmp.len()
11255 }
11256 }
11257}
11258#[doc = "id: 6"]
11259#[doc = "Accept / deny control of this MAV."]
11260#[derive(Debug, Clone, PartialEq)]
11261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11263pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
11264 #[doc = "ID of the GCS this message"]
11265 pub gcs_system_id: u8,
11266 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
11267 pub control_request: u8,
11268 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
11269 pub ack: u8,
11270}
11271impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
11272 pub const ENCODED_LEN: usize = 3usize;
11273 pub const DEFAULT: Self = Self {
11274 gcs_system_id: 0_u8,
11275 control_request: 0_u8,
11276 ack: 0_u8,
11277 };
11278 #[cfg(feature = "arbitrary")]
11279 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11280 use arbitrary::{Arbitrary, Unstructured};
11281 let mut buf = [0u8; 1024];
11282 rng.fill_bytes(&mut buf);
11283 let mut unstructured = Unstructured::new(&buf);
11284 Self::arbitrary(&mut unstructured).unwrap_or_default()
11285 }
11286}
11287impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
11288 fn default() -> Self {
11289 Self::DEFAULT.clone()
11290 }
11291}
11292impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
11293 type Message = MavMessage;
11294 const ID: u32 = 6u32;
11295 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
11296 const EXTRA_CRC: u8 = 104u8;
11297 const ENCODED_LEN: usize = 3usize;
11298 fn deser(
11299 _version: MavlinkVersion,
11300 __input: &[u8],
11301 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11302 let avail_len = __input.len();
11303 let mut payload_buf = [0; Self::ENCODED_LEN];
11304 let mut buf = if avail_len < Self::ENCODED_LEN {
11305 payload_buf[0..avail_len].copy_from_slice(__input);
11306 Bytes::new(&payload_buf)
11307 } else {
11308 Bytes::new(__input)
11309 };
11310 let mut __struct = Self::default();
11311 __struct.gcs_system_id = buf.get_u8();
11312 __struct.control_request = buf.get_u8();
11313 __struct.ack = buf.get_u8();
11314 Ok(__struct)
11315 }
11316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11317 let mut __tmp = BytesMut::new(bytes);
11318 #[allow(clippy::absurd_extreme_comparisons)]
11319 #[allow(unused_comparisons)]
11320 if __tmp.remaining() < Self::ENCODED_LEN {
11321 panic!(
11322 "buffer is too small (need {} bytes, but got {})",
11323 Self::ENCODED_LEN,
11324 __tmp.remaining(),
11325 )
11326 }
11327 __tmp.put_u8(self.gcs_system_id);
11328 __tmp.put_u8(self.control_request);
11329 __tmp.put_u8(self.ack);
11330 if matches!(version, MavlinkVersion::V2) {
11331 let len = __tmp.len();
11332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11333 } else {
11334 __tmp.len()
11335 }
11336 }
11337}
11338#[doc = "id: 247"]
11339#[doc = "Information about a potential collision."]
11340#[derive(Debug, Clone, PartialEq)]
11341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11343pub struct COLLISION_DATA {
11344 #[doc = "Unique identifier, domain based on src field"]
11345 pub id: u32,
11346 #[doc = "Estimated time until collision occurs"]
11347 pub time_to_minimum_delta: f32,
11348 #[doc = "Closest vertical distance between vehicle and object"]
11349 pub altitude_minimum_delta: f32,
11350 #[doc = "Closest horizontal distance between vehicle and object"]
11351 pub horizontal_minimum_delta: f32,
11352 #[doc = "Collision data source"]
11353 pub src: MavCollisionSrc,
11354 #[doc = "Action that is being taken to avoid this collision"]
11355 pub action: MavCollisionAction,
11356 #[doc = "How concerned the aircraft is about this collision"]
11357 pub threat_level: MavCollisionThreatLevel,
11358}
11359impl COLLISION_DATA {
11360 pub const ENCODED_LEN: usize = 19usize;
11361 pub const DEFAULT: Self = Self {
11362 id: 0_u32,
11363 time_to_minimum_delta: 0.0_f32,
11364 altitude_minimum_delta: 0.0_f32,
11365 horizontal_minimum_delta: 0.0_f32,
11366 src: MavCollisionSrc::DEFAULT,
11367 action: MavCollisionAction::DEFAULT,
11368 threat_level: MavCollisionThreatLevel::DEFAULT,
11369 };
11370 #[cfg(feature = "arbitrary")]
11371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11372 use arbitrary::{Arbitrary, Unstructured};
11373 let mut buf = [0u8; 1024];
11374 rng.fill_bytes(&mut buf);
11375 let mut unstructured = Unstructured::new(&buf);
11376 Self::arbitrary(&mut unstructured).unwrap_or_default()
11377 }
11378}
11379impl Default for COLLISION_DATA {
11380 fn default() -> Self {
11381 Self::DEFAULT.clone()
11382 }
11383}
11384impl MessageData for COLLISION_DATA {
11385 type Message = MavMessage;
11386 const ID: u32 = 247u32;
11387 const NAME: &'static str = "COLLISION";
11388 const EXTRA_CRC: u8 = 81u8;
11389 const ENCODED_LEN: usize = 19usize;
11390 fn deser(
11391 _version: MavlinkVersion,
11392 __input: &[u8],
11393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11394 let avail_len = __input.len();
11395 let mut payload_buf = [0; Self::ENCODED_LEN];
11396 let mut buf = if avail_len < Self::ENCODED_LEN {
11397 payload_buf[0..avail_len].copy_from_slice(__input);
11398 Bytes::new(&payload_buf)
11399 } else {
11400 Bytes::new(__input)
11401 };
11402 let mut __struct = Self::default();
11403 __struct.id = buf.get_u32_le();
11404 __struct.time_to_minimum_delta = buf.get_f32_le();
11405 __struct.altitude_minimum_delta = buf.get_f32_le();
11406 __struct.horizontal_minimum_delta = buf.get_f32_le();
11407 let tmp = buf.get_u8();
11408 __struct.src =
11409 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11410 enum_type: "MavCollisionSrc",
11411 value: tmp as u32,
11412 })?;
11413 let tmp = buf.get_u8();
11414 __struct.action =
11415 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11416 enum_type: "MavCollisionAction",
11417 value: tmp as u32,
11418 })?;
11419 let tmp = buf.get_u8();
11420 __struct.threat_level =
11421 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11422 enum_type: "MavCollisionThreatLevel",
11423 value: tmp as u32,
11424 })?;
11425 Ok(__struct)
11426 }
11427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11428 let mut __tmp = BytesMut::new(bytes);
11429 #[allow(clippy::absurd_extreme_comparisons)]
11430 #[allow(unused_comparisons)]
11431 if __tmp.remaining() < Self::ENCODED_LEN {
11432 panic!(
11433 "buffer is too small (need {} bytes, but got {})",
11434 Self::ENCODED_LEN,
11435 __tmp.remaining(),
11436 )
11437 }
11438 __tmp.put_u32_le(self.id);
11439 __tmp.put_f32_le(self.time_to_minimum_delta);
11440 __tmp.put_f32_le(self.altitude_minimum_delta);
11441 __tmp.put_f32_le(self.horizontal_minimum_delta);
11442 __tmp.put_u8(self.src as u8);
11443 __tmp.put_u8(self.action as u8);
11444 __tmp.put_u8(self.threat_level as u8);
11445 if matches!(version, MavlinkVersion::V2) {
11446 let len = __tmp.len();
11447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11448 } else {
11449 __tmp.len()
11450 }
11451 }
11452}
11453#[doc = "id: 77"]
11454#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
11455#[derive(Debug, Clone, PartialEq)]
11456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11457#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11458pub struct COMMAND_ACK_DATA {
11459 #[doc = "Command ID (of acknowledged command)."]
11460 pub command: MavCmd,
11461 #[doc = "Result of command."]
11462 pub result: MavResult,
11463 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
11464 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11465 pub progress: u8,
11466 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
11467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11468 pub result_param2: i32,
11469 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
11470 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11471 pub target_system: u8,
11472 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
11473 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11474 pub target_component: u8,
11475}
11476impl COMMAND_ACK_DATA {
11477 pub const ENCODED_LEN: usize = 10usize;
11478 pub const DEFAULT: Self = Self {
11479 command: MavCmd::DEFAULT,
11480 result: MavResult::DEFAULT,
11481 progress: 0_u8,
11482 result_param2: 0_i32,
11483 target_system: 0_u8,
11484 target_component: 0_u8,
11485 };
11486 #[cfg(feature = "arbitrary")]
11487 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11488 use arbitrary::{Arbitrary, Unstructured};
11489 let mut buf = [0u8; 1024];
11490 rng.fill_bytes(&mut buf);
11491 let mut unstructured = Unstructured::new(&buf);
11492 Self::arbitrary(&mut unstructured).unwrap_or_default()
11493 }
11494}
11495impl Default for COMMAND_ACK_DATA {
11496 fn default() -> Self {
11497 Self::DEFAULT.clone()
11498 }
11499}
11500impl MessageData for COMMAND_ACK_DATA {
11501 type Message = MavMessage;
11502 const ID: u32 = 77u32;
11503 const NAME: &'static str = "COMMAND_ACK";
11504 const EXTRA_CRC: u8 = 143u8;
11505 const ENCODED_LEN: usize = 10usize;
11506 fn deser(
11507 _version: MavlinkVersion,
11508 __input: &[u8],
11509 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11510 let avail_len = __input.len();
11511 let mut payload_buf = [0; Self::ENCODED_LEN];
11512 let mut buf = if avail_len < Self::ENCODED_LEN {
11513 payload_buf[0..avail_len].copy_from_slice(__input);
11514 Bytes::new(&payload_buf)
11515 } else {
11516 Bytes::new(__input)
11517 };
11518 let mut __struct = Self::default();
11519 let tmp = buf.get_u16_le();
11520 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11521 ::mavlink_core::error::ParserError::InvalidEnum {
11522 enum_type: "MavCmd",
11523 value: tmp as u32,
11524 },
11525 )?;
11526 let tmp = buf.get_u8();
11527 __struct.result =
11528 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11529 enum_type: "MavResult",
11530 value: tmp as u32,
11531 })?;
11532 __struct.progress = buf.get_u8();
11533 __struct.result_param2 = buf.get_i32_le();
11534 __struct.target_system = buf.get_u8();
11535 __struct.target_component = buf.get_u8();
11536 Ok(__struct)
11537 }
11538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11539 let mut __tmp = BytesMut::new(bytes);
11540 #[allow(clippy::absurd_extreme_comparisons)]
11541 #[allow(unused_comparisons)]
11542 if __tmp.remaining() < Self::ENCODED_LEN {
11543 panic!(
11544 "buffer is too small (need {} bytes, but got {})",
11545 Self::ENCODED_LEN,
11546 __tmp.remaining(),
11547 )
11548 }
11549 __tmp.put_u16_le(self.command as u16);
11550 __tmp.put_u8(self.result as u8);
11551 __tmp.put_u8(self.progress);
11552 __tmp.put_i32_le(self.result_param2);
11553 __tmp.put_u8(self.target_system);
11554 __tmp.put_u8(self.target_component);
11555 if matches!(version, MavlinkVersion::V2) {
11556 let len = __tmp.len();
11557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11558 } else {
11559 __tmp.len()
11560 }
11561 }
11562}
11563#[doc = "id: 80"]
11564#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
11565#[derive(Debug, Clone, PartialEq)]
11566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11568pub struct COMMAND_CANCEL_DATA {
11569 #[doc = "Command ID (of command to cancel)."]
11570 pub command: MavCmd,
11571 #[doc = "System executing long running command. Should not be broadcast (0)."]
11572 pub target_system: u8,
11573 #[doc = "Component executing long running command."]
11574 pub target_component: u8,
11575}
11576impl COMMAND_CANCEL_DATA {
11577 pub const ENCODED_LEN: usize = 4usize;
11578 pub const DEFAULT: Self = Self {
11579 command: MavCmd::DEFAULT,
11580 target_system: 0_u8,
11581 target_component: 0_u8,
11582 };
11583 #[cfg(feature = "arbitrary")]
11584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11585 use arbitrary::{Arbitrary, Unstructured};
11586 let mut buf = [0u8; 1024];
11587 rng.fill_bytes(&mut buf);
11588 let mut unstructured = Unstructured::new(&buf);
11589 Self::arbitrary(&mut unstructured).unwrap_or_default()
11590 }
11591}
11592impl Default for COMMAND_CANCEL_DATA {
11593 fn default() -> Self {
11594 Self::DEFAULT.clone()
11595 }
11596}
11597impl MessageData for COMMAND_CANCEL_DATA {
11598 type Message = MavMessage;
11599 const ID: u32 = 80u32;
11600 const NAME: &'static str = "COMMAND_CANCEL";
11601 const EXTRA_CRC: u8 = 14u8;
11602 const ENCODED_LEN: usize = 4usize;
11603 fn deser(
11604 _version: MavlinkVersion,
11605 __input: &[u8],
11606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11607 let avail_len = __input.len();
11608 let mut payload_buf = [0; Self::ENCODED_LEN];
11609 let mut buf = if avail_len < Self::ENCODED_LEN {
11610 payload_buf[0..avail_len].copy_from_slice(__input);
11611 Bytes::new(&payload_buf)
11612 } else {
11613 Bytes::new(__input)
11614 };
11615 let mut __struct = Self::default();
11616 let tmp = buf.get_u16_le();
11617 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11618 ::mavlink_core::error::ParserError::InvalidEnum {
11619 enum_type: "MavCmd",
11620 value: tmp as u32,
11621 },
11622 )?;
11623 __struct.target_system = buf.get_u8();
11624 __struct.target_component = buf.get_u8();
11625 Ok(__struct)
11626 }
11627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11628 let mut __tmp = BytesMut::new(bytes);
11629 #[allow(clippy::absurd_extreme_comparisons)]
11630 #[allow(unused_comparisons)]
11631 if __tmp.remaining() < Self::ENCODED_LEN {
11632 panic!(
11633 "buffer is too small (need {} bytes, but got {})",
11634 Self::ENCODED_LEN,
11635 __tmp.remaining(),
11636 )
11637 }
11638 __tmp.put_u16_le(self.command as u16);
11639 __tmp.put_u8(self.target_system);
11640 __tmp.put_u8(self.target_component);
11641 if matches!(version, MavlinkVersion::V2) {
11642 let len = __tmp.len();
11643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11644 } else {
11645 __tmp.len()
11646 }
11647 }
11648}
11649#[doc = "id: 75"]
11650#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
11651#[derive(Debug, Clone, PartialEq)]
11652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11654pub struct COMMAND_INT_DATA {
11655 #[doc = "PARAM1, see MAV_CMD enum"]
11656 pub param1: f32,
11657 #[doc = "PARAM2, see MAV_CMD enum"]
11658 pub param2: f32,
11659 #[doc = "PARAM3, see MAV_CMD enum"]
11660 pub param3: f32,
11661 #[doc = "PARAM4, see MAV_CMD enum"]
11662 pub param4: f32,
11663 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
11664 pub x: i32,
11665 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
11666 pub y: i32,
11667 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
11668 pub z: f32,
11669 #[doc = "The scheduled action for the mission item."]
11670 pub command: MavCmd,
11671 #[doc = "System ID"]
11672 pub target_system: u8,
11673 #[doc = "Component ID"]
11674 pub target_component: u8,
11675 #[doc = "The coordinate system of the COMMAND."]
11676 pub frame: MavFrame,
11677 #[doc = "Not used."]
11678 pub current: u8,
11679 #[doc = "Not used (set 0)."]
11680 pub autocontinue: u8,
11681}
11682impl COMMAND_INT_DATA {
11683 pub const ENCODED_LEN: usize = 35usize;
11684 pub const DEFAULT: Self = Self {
11685 param1: 0.0_f32,
11686 param2: 0.0_f32,
11687 param3: 0.0_f32,
11688 param4: 0.0_f32,
11689 x: 0_i32,
11690 y: 0_i32,
11691 z: 0.0_f32,
11692 command: MavCmd::DEFAULT,
11693 target_system: 0_u8,
11694 target_component: 0_u8,
11695 frame: MavFrame::DEFAULT,
11696 current: 0_u8,
11697 autocontinue: 0_u8,
11698 };
11699 #[cfg(feature = "arbitrary")]
11700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11701 use arbitrary::{Arbitrary, Unstructured};
11702 let mut buf = [0u8; 1024];
11703 rng.fill_bytes(&mut buf);
11704 let mut unstructured = Unstructured::new(&buf);
11705 Self::arbitrary(&mut unstructured).unwrap_or_default()
11706 }
11707}
11708impl Default for COMMAND_INT_DATA {
11709 fn default() -> Self {
11710 Self::DEFAULT.clone()
11711 }
11712}
11713impl MessageData for COMMAND_INT_DATA {
11714 type Message = MavMessage;
11715 const ID: u32 = 75u32;
11716 const NAME: &'static str = "COMMAND_INT";
11717 const EXTRA_CRC: u8 = 158u8;
11718 const ENCODED_LEN: usize = 35usize;
11719 fn deser(
11720 _version: MavlinkVersion,
11721 __input: &[u8],
11722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11723 let avail_len = __input.len();
11724 let mut payload_buf = [0; Self::ENCODED_LEN];
11725 let mut buf = if avail_len < Self::ENCODED_LEN {
11726 payload_buf[0..avail_len].copy_from_slice(__input);
11727 Bytes::new(&payload_buf)
11728 } else {
11729 Bytes::new(__input)
11730 };
11731 let mut __struct = Self::default();
11732 __struct.param1 = buf.get_f32_le();
11733 __struct.param2 = buf.get_f32_le();
11734 __struct.param3 = buf.get_f32_le();
11735 __struct.param4 = buf.get_f32_le();
11736 __struct.x = buf.get_i32_le();
11737 __struct.y = buf.get_i32_le();
11738 __struct.z = buf.get_f32_le();
11739 let tmp = buf.get_u16_le();
11740 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11741 ::mavlink_core::error::ParserError::InvalidEnum {
11742 enum_type: "MavCmd",
11743 value: tmp as u32,
11744 },
11745 )?;
11746 __struct.target_system = buf.get_u8();
11747 __struct.target_component = buf.get_u8();
11748 let tmp = buf.get_u8();
11749 __struct.frame =
11750 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11751 enum_type: "MavFrame",
11752 value: tmp as u32,
11753 })?;
11754 __struct.current = buf.get_u8();
11755 __struct.autocontinue = buf.get_u8();
11756 Ok(__struct)
11757 }
11758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11759 let mut __tmp = BytesMut::new(bytes);
11760 #[allow(clippy::absurd_extreme_comparisons)]
11761 #[allow(unused_comparisons)]
11762 if __tmp.remaining() < Self::ENCODED_LEN {
11763 panic!(
11764 "buffer is too small (need {} bytes, but got {})",
11765 Self::ENCODED_LEN,
11766 __tmp.remaining(),
11767 )
11768 }
11769 __tmp.put_f32_le(self.param1);
11770 __tmp.put_f32_le(self.param2);
11771 __tmp.put_f32_le(self.param3);
11772 __tmp.put_f32_le(self.param4);
11773 __tmp.put_i32_le(self.x);
11774 __tmp.put_i32_le(self.y);
11775 __tmp.put_f32_le(self.z);
11776 __tmp.put_u16_le(self.command as u16);
11777 __tmp.put_u8(self.target_system);
11778 __tmp.put_u8(self.target_component);
11779 __tmp.put_u8(self.frame as u8);
11780 __tmp.put_u8(self.current);
11781 __tmp.put_u8(self.autocontinue);
11782 if matches!(version, MavlinkVersion::V2) {
11783 let len = __tmp.len();
11784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11785 } else {
11786 __tmp.len()
11787 }
11788 }
11789}
11790#[doc = "id: 76"]
11791#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
11792#[derive(Debug, Clone, PartialEq)]
11793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11795pub struct COMMAND_LONG_DATA {
11796 #[doc = "Parameter 1 (for the specific command)."]
11797 pub param1: f32,
11798 #[doc = "Parameter 2 (for the specific command)."]
11799 pub param2: f32,
11800 #[doc = "Parameter 3 (for the specific command)."]
11801 pub param3: f32,
11802 #[doc = "Parameter 4 (for the specific command)."]
11803 pub param4: f32,
11804 #[doc = "Parameter 5 (for the specific command)."]
11805 pub param5: f32,
11806 #[doc = "Parameter 6 (for the specific command)."]
11807 pub param6: f32,
11808 #[doc = "Parameter 7 (for the specific command)."]
11809 pub param7: f32,
11810 #[doc = "Command ID (of command to send)."]
11811 pub command: MavCmd,
11812 #[doc = "System which should execute the command"]
11813 pub target_system: u8,
11814 #[doc = "Component which should execute the command, 0 for all components"]
11815 pub target_component: u8,
11816 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
11817 pub confirmation: u8,
11818}
11819impl COMMAND_LONG_DATA {
11820 pub const ENCODED_LEN: usize = 33usize;
11821 pub const DEFAULT: Self = Self {
11822 param1: 0.0_f32,
11823 param2: 0.0_f32,
11824 param3: 0.0_f32,
11825 param4: 0.0_f32,
11826 param5: 0.0_f32,
11827 param6: 0.0_f32,
11828 param7: 0.0_f32,
11829 command: MavCmd::DEFAULT,
11830 target_system: 0_u8,
11831 target_component: 0_u8,
11832 confirmation: 0_u8,
11833 };
11834 #[cfg(feature = "arbitrary")]
11835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11836 use arbitrary::{Arbitrary, Unstructured};
11837 let mut buf = [0u8; 1024];
11838 rng.fill_bytes(&mut buf);
11839 let mut unstructured = Unstructured::new(&buf);
11840 Self::arbitrary(&mut unstructured).unwrap_or_default()
11841 }
11842}
11843impl Default for COMMAND_LONG_DATA {
11844 fn default() -> Self {
11845 Self::DEFAULT.clone()
11846 }
11847}
11848impl MessageData for COMMAND_LONG_DATA {
11849 type Message = MavMessage;
11850 const ID: u32 = 76u32;
11851 const NAME: &'static str = "COMMAND_LONG";
11852 const EXTRA_CRC: u8 = 152u8;
11853 const ENCODED_LEN: usize = 33usize;
11854 fn deser(
11855 _version: MavlinkVersion,
11856 __input: &[u8],
11857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11858 let avail_len = __input.len();
11859 let mut payload_buf = [0; Self::ENCODED_LEN];
11860 let mut buf = if avail_len < Self::ENCODED_LEN {
11861 payload_buf[0..avail_len].copy_from_slice(__input);
11862 Bytes::new(&payload_buf)
11863 } else {
11864 Bytes::new(__input)
11865 };
11866 let mut __struct = Self::default();
11867 __struct.param1 = buf.get_f32_le();
11868 __struct.param2 = buf.get_f32_le();
11869 __struct.param3 = buf.get_f32_le();
11870 __struct.param4 = buf.get_f32_le();
11871 __struct.param5 = buf.get_f32_le();
11872 __struct.param6 = buf.get_f32_le();
11873 __struct.param7 = buf.get_f32_le();
11874 let tmp = buf.get_u16_le();
11875 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
11876 ::mavlink_core::error::ParserError::InvalidEnum {
11877 enum_type: "MavCmd",
11878 value: tmp as u32,
11879 },
11880 )?;
11881 __struct.target_system = buf.get_u8();
11882 __struct.target_component = buf.get_u8();
11883 __struct.confirmation = buf.get_u8();
11884 Ok(__struct)
11885 }
11886 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11887 let mut __tmp = BytesMut::new(bytes);
11888 #[allow(clippy::absurd_extreme_comparisons)]
11889 #[allow(unused_comparisons)]
11890 if __tmp.remaining() < Self::ENCODED_LEN {
11891 panic!(
11892 "buffer is too small (need {} bytes, but got {})",
11893 Self::ENCODED_LEN,
11894 __tmp.remaining(),
11895 )
11896 }
11897 __tmp.put_f32_le(self.param1);
11898 __tmp.put_f32_le(self.param2);
11899 __tmp.put_f32_le(self.param3);
11900 __tmp.put_f32_le(self.param4);
11901 __tmp.put_f32_le(self.param5);
11902 __tmp.put_f32_le(self.param6);
11903 __tmp.put_f32_le(self.param7);
11904 __tmp.put_u16_le(self.command as u16);
11905 __tmp.put_u8(self.target_system);
11906 __tmp.put_u8(self.target_component);
11907 __tmp.put_u8(self.confirmation);
11908 if matches!(version, MavlinkVersion::V2) {
11909 let len = __tmp.len();
11910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11911 } else {
11912 __tmp.len()
11913 }
11914 }
11915}
11916#[doc = "id: 177"]
11917#[doc = "Status of compassmot calibration."]
11918#[derive(Debug, Clone, PartialEq)]
11919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11921pub struct COMPASSMOT_STATUS_DATA {
11922 #[doc = "Current."]
11923 pub current: f32,
11924 #[doc = "Motor Compensation X."]
11925 pub CompensationX: f32,
11926 #[doc = "Motor Compensation Y."]
11927 pub CompensationY: f32,
11928 #[doc = "Motor Compensation Z."]
11929 pub CompensationZ: f32,
11930 #[doc = "Throttle."]
11931 pub throttle: u16,
11932 #[doc = "Interference."]
11933 pub interference: u16,
11934}
11935impl COMPASSMOT_STATUS_DATA {
11936 pub const ENCODED_LEN: usize = 20usize;
11937 pub const DEFAULT: Self = Self {
11938 current: 0.0_f32,
11939 CompensationX: 0.0_f32,
11940 CompensationY: 0.0_f32,
11941 CompensationZ: 0.0_f32,
11942 throttle: 0_u16,
11943 interference: 0_u16,
11944 };
11945 #[cfg(feature = "arbitrary")]
11946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11947 use arbitrary::{Arbitrary, Unstructured};
11948 let mut buf = [0u8; 1024];
11949 rng.fill_bytes(&mut buf);
11950 let mut unstructured = Unstructured::new(&buf);
11951 Self::arbitrary(&mut unstructured).unwrap_or_default()
11952 }
11953}
11954impl Default for COMPASSMOT_STATUS_DATA {
11955 fn default() -> Self {
11956 Self::DEFAULT.clone()
11957 }
11958}
11959impl MessageData for COMPASSMOT_STATUS_DATA {
11960 type Message = MavMessage;
11961 const ID: u32 = 177u32;
11962 const NAME: &'static str = "COMPASSMOT_STATUS";
11963 const EXTRA_CRC: u8 = 240u8;
11964 const ENCODED_LEN: usize = 20usize;
11965 fn deser(
11966 _version: MavlinkVersion,
11967 __input: &[u8],
11968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11969 let avail_len = __input.len();
11970 let mut payload_buf = [0; Self::ENCODED_LEN];
11971 let mut buf = if avail_len < Self::ENCODED_LEN {
11972 payload_buf[0..avail_len].copy_from_slice(__input);
11973 Bytes::new(&payload_buf)
11974 } else {
11975 Bytes::new(__input)
11976 };
11977 let mut __struct = Self::default();
11978 __struct.current = buf.get_f32_le();
11979 __struct.CompensationX = buf.get_f32_le();
11980 __struct.CompensationY = buf.get_f32_le();
11981 __struct.CompensationZ = buf.get_f32_le();
11982 __struct.throttle = buf.get_u16_le();
11983 __struct.interference = buf.get_u16_le();
11984 Ok(__struct)
11985 }
11986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11987 let mut __tmp = BytesMut::new(bytes);
11988 #[allow(clippy::absurd_extreme_comparisons)]
11989 #[allow(unused_comparisons)]
11990 if __tmp.remaining() < Self::ENCODED_LEN {
11991 panic!(
11992 "buffer is too small (need {} bytes, but got {})",
11993 Self::ENCODED_LEN,
11994 __tmp.remaining(),
11995 )
11996 }
11997 __tmp.put_f32_le(self.current);
11998 __tmp.put_f32_le(self.CompensationX);
11999 __tmp.put_f32_le(self.CompensationY);
12000 __tmp.put_f32_le(self.CompensationZ);
12001 __tmp.put_u16_le(self.throttle);
12002 __tmp.put_u16_le(self.interference);
12003 if matches!(version, MavlinkVersion::V2) {
12004 let len = __tmp.len();
12005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12006 } else {
12007 __tmp.len()
12008 }
12009 }
12010}
12011#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
12012#[doc = "id: 395"]
12013#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
12014#[derive(Debug, Clone, PartialEq)]
12015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12017pub struct COMPONENT_INFORMATION_DATA {
12018 #[doc = "Timestamp (time since system boot)."]
12019 pub time_boot_ms: u32,
12020 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
12021 pub general_metadata_file_crc: u32,
12022 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
12023 pub peripherals_metadata_file_crc: u32,
12024 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
12025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12026 pub general_metadata_uri: [u8; 100],
12027 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
12028 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12029 pub peripherals_metadata_uri: [u8; 100],
12030}
12031impl COMPONENT_INFORMATION_DATA {
12032 pub const ENCODED_LEN: usize = 212usize;
12033 pub const DEFAULT: Self = Self {
12034 time_boot_ms: 0_u32,
12035 general_metadata_file_crc: 0_u32,
12036 peripherals_metadata_file_crc: 0_u32,
12037 general_metadata_uri: [0_u8; 100usize],
12038 peripherals_metadata_uri: [0_u8; 100usize],
12039 };
12040 #[cfg(feature = "arbitrary")]
12041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12042 use arbitrary::{Arbitrary, Unstructured};
12043 let mut buf = [0u8; 1024];
12044 rng.fill_bytes(&mut buf);
12045 let mut unstructured = Unstructured::new(&buf);
12046 Self::arbitrary(&mut unstructured).unwrap_or_default()
12047 }
12048}
12049impl Default for COMPONENT_INFORMATION_DATA {
12050 fn default() -> Self {
12051 Self::DEFAULT.clone()
12052 }
12053}
12054impl MessageData for COMPONENT_INFORMATION_DATA {
12055 type Message = MavMessage;
12056 const ID: u32 = 395u32;
12057 const NAME: &'static str = "COMPONENT_INFORMATION";
12058 const EXTRA_CRC: u8 = 0u8;
12059 const ENCODED_LEN: usize = 212usize;
12060 fn deser(
12061 _version: MavlinkVersion,
12062 __input: &[u8],
12063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12064 let avail_len = __input.len();
12065 let mut payload_buf = [0; Self::ENCODED_LEN];
12066 let mut buf = if avail_len < Self::ENCODED_LEN {
12067 payload_buf[0..avail_len].copy_from_slice(__input);
12068 Bytes::new(&payload_buf)
12069 } else {
12070 Bytes::new(__input)
12071 };
12072 let mut __struct = Self::default();
12073 __struct.time_boot_ms = buf.get_u32_le();
12074 __struct.general_metadata_file_crc = buf.get_u32_le();
12075 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
12076 for v in &mut __struct.general_metadata_uri {
12077 let val = buf.get_u8();
12078 *v = val;
12079 }
12080 for v in &mut __struct.peripherals_metadata_uri {
12081 let val = buf.get_u8();
12082 *v = val;
12083 }
12084 Ok(__struct)
12085 }
12086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12087 let mut __tmp = BytesMut::new(bytes);
12088 #[allow(clippy::absurd_extreme_comparisons)]
12089 #[allow(unused_comparisons)]
12090 if __tmp.remaining() < Self::ENCODED_LEN {
12091 panic!(
12092 "buffer is too small (need {} bytes, but got {})",
12093 Self::ENCODED_LEN,
12094 __tmp.remaining(),
12095 )
12096 }
12097 __tmp.put_u32_le(self.time_boot_ms);
12098 __tmp.put_u32_le(self.general_metadata_file_crc);
12099 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
12100 for val in &self.general_metadata_uri {
12101 __tmp.put_u8(*val);
12102 }
12103 for val in &self.peripherals_metadata_uri {
12104 __tmp.put_u8(*val);
12105 }
12106 if matches!(version, MavlinkVersion::V2) {
12107 let len = __tmp.len();
12108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12109 } else {
12110 __tmp.len()
12111 }
12112 }
12113}
12114#[doc = "id: 396"]
12115#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
12116#[derive(Debug, Clone, PartialEq)]
12117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12119pub struct COMPONENT_INFORMATION_BASIC_DATA {
12120 #[doc = "Component capability flags"]
12121 pub capabilities: MavProtocolCapability,
12122 #[doc = "Timestamp (time since system boot)."]
12123 pub time_boot_ms: u32,
12124 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
12125 pub time_manufacture_s: u32,
12126 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
12127 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12128 pub vendor_name: [u8; 32],
12129 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
12130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12131 pub model_name: [u8; 32],
12132 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
12133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12134 pub software_version: [u8; 24],
12135 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
12136 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12137 pub hardware_version: [u8; 24],
12138 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
12139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12140 pub serial_number: [u8; 32],
12141}
12142impl COMPONENT_INFORMATION_BASIC_DATA {
12143 pub const ENCODED_LEN: usize = 160usize;
12144 pub const DEFAULT: Self = Self {
12145 capabilities: MavProtocolCapability::DEFAULT,
12146 time_boot_ms: 0_u32,
12147 time_manufacture_s: 0_u32,
12148 vendor_name: [0_u8; 32usize],
12149 model_name: [0_u8; 32usize],
12150 software_version: [0_u8; 24usize],
12151 hardware_version: [0_u8; 24usize],
12152 serial_number: [0_u8; 32usize],
12153 };
12154 #[cfg(feature = "arbitrary")]
12155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12156 use arbitrary::{Arbitrary, Unstructured};
12157 let mut buf = [0u8; 1024];
12158 rng.fill_bytes(&mut buf);
12159 let mut unstructured = Unstructured::new(&buf);
12160 Self::arbitrary(&mut unstructured).unwrap_or_default()
12161 }
12162}
12163impl Default for COMPONENT_INFORMATION_BASIC_DATA {
12164 fn default() -> Self {
12165 Self::DEFAULT.clone()
12166 }
12167}
12168impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
12169 type Message = MavMessage;
12170 const ID: u32 = 396u32;
12171 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
12172 const EXTRA_CRC: u8 = 50u8;
12173 const ENCODED_LEN: usize = 160usize;
12174 fn deser(
12175 _version: MavlinkVersion,
12176 __input: &[u8],
12177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12178 let avail_len = __input.len();
12179 let mut payload_buf = [0; Self::ENCODED_LEN];
12180 let mut buf = if avail_len < Self::ENCODED_LEN {
12181 payload_buf[0..avail_len].copy_from_slice(__input);
12182 Bytes::new(&payload_buf)
12183 } else {
12184 Bytes::new(__input)
12185 };
12186 let mut __struct = Self::default();
12187 let tmp = buf.get_u64_le();
12188 __struct.capabilities = MavProtocolCapability::from_bits(
12189 tmp & MavProtocolCapability::all().bits(),
12190 )
12191 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12192 flag_type: "MavProtocolCapability",
12193 value: tmp as u32,
12194 })?;
12195 __struct.time_boot_ms = buf.get_u32_le();
12196 __struct.time_manufacture_s = buf.get_u32_le();
12197 for v in &mut __struct.vendor_name {
12198 let val = buf.get_u8();
12199 *v = val;
12200 }
12201 for v in &mut __struct.model_name {
12202 let val = buf.get_u8();
12203 *v = val;
12204 }
12205 for v in &mut __struct.software_version {
12206 let val = buf.get_u8();
12207 *v = val;
12208 }
12209 for v in &mut __struct.hardware_version {
12210 let val = buf.get_u8();
12211 *v = val;
12212 }
12213 for v in &mut __struct.serial_number {
12214 let val = buf.get_u8();
12215 *v = val;
12216 }
12217 Ok(__struct)
12218 }
12219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12220 let mut __tmp = BytesMut::new(bytes);
12221 #[allow(clippy::absurd_extreme_comparisons)]
12222 #[allow(unused_comparisons)]
12223 if __tmp.remaining() < Self::ENCODED_LEN {
12224 panic!(
12225 "buffer is too small (need {} bytes, but got {})",
12226 Self::ENCODED_LEN,
12227 __tmp.remaining(),
12228 )
12229 }
12230 __tmp.put_u64_le(self.capabilities.bits());
12231 __tmp.put_u32_le(self.time_boot_ms);
12232 __tmp.put_u32_le(self.time_manufacture_s);
12233 for val in &self.vendor_name {
12234 __tmp.put_u8(*val);
12235 }
12236 for val in &self.model_name {
12237 __tmp.put_u8(*val);
12238 }
12239 for val in &self.software_version {
12240 __tmp.put_u8(*val);
12241 }
12242 for val in &self.hardware_version {
12243 __tmp.put_u8(*val);
12244 }
12245 for val in &self.serial_number {
12246 __tmp.put_u8(*val);
12247 }
12248 if matches!(version, MavlinkVersion::V2) {
12249 let len = __tmp.len();
12250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12251 } else {
12252 __tmp.len()
12253 }
12254 }
12255}
12256#[doc = "id: 397"]
12257#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
12258#[derive(Debug, Clone, PartialEq)]
12259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12261pub struct COMPONENT_METADATA_DATA {
12262 #[doc = "Timestamp (time since system boot)."]
12263 pub time_boot_ms: u32,
12264 #[doc = "CRC32 of the general metadata file."]
12265 pub file_crc: u32,
12266 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
12267 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12268 pub uri: [u8; 100],
12269}
12270impl COMPONENT_METADATA_DATA {
12271 pub const ENCODED_LEN: usize = 108usize;
12272 pub const DEFAULT: Self = Self {
12273 time_boot_ms: 0_u32,
12274 file_crc: 0_u32,
12275 uri: [0_u8; 100usize],
12276 };
12277 #[cfg(feature = "arbitrary")]
12278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12279 use arbitrary::{Arbitrary, Unstructured};
12280 let mut buf = [0u8; 1024];
12281 rng.fill_bytes(&mut buf);
12282 let mut unstructured = Unstructured::new(&buf);
12283 Self::arbitrary(&mut unstructured).unwrap_or_default()
12284 }
12285}
12286impl Default for COMPONENT_METADATA_DATA {
12287 fn default() -> Self {
12288 Self::DEFAULT.clone()
12289 }
12290}
12291impl MessageData for COMPONENT_METADATA_DATA {
12292 type Message = MavMessage;
12293 const ID: u32 = 397u32;
12294 const NAME: &'static str = "COMPONENT_METADATA";
12295 const EXTRA_CRC: u8 = 182u8;
12296 const ENCODED_LEN: usize = 108usize;
12297 fn deser(
12298 _version: MavlinkVersion,
12299 __input: &[u8],
12300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12301 let avail_len = __input.len();
12302 let mut payload_buf = [0; Self::ENCODED_LEN];
12303 let mut buf = if avail_len < Self::ENCODED_LEN {
12304 payload_buf[0..avail_len].copy_from_slice(__input);
12305 Bytes::new(&payload_buf)
12306 } else {
12307 Bytes::new(__input)
12308 };
12309 let mut __struct = Self::default();
12310 __struct.time_boot_ms = buf.get_u32_le();
12311 __struct.file_crc = buf.get_u32_le();
12312 for v in &mut __struct.uri {
12313 let val = buf.get_u8();
12314 *v = val;
12315 }
12316 Ok(__struct)
12317 }
12318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12319 let mut __tmp = BytesMut::new(bytes);
12320 #[allow(clippy::absurd_extreme_comparisons)]
12321 #[allow(unused_comparisons)]
12322 if __tmp.remaining() < Self::ENCODED_LEN {
12323 panic!(
12324 "buffer is too small (need {} bytes, but got {})",
12325 Self::ENCODED_LEN,
12326 __tmp.remaining(),
12327 )
12328 }
12329 __tmp.put_u32_le(self.time_boot_ms);
12330 __tmp.put_u32_le(self.file_crc);
12331 for val in &self.uri {
12332 __tmp.put_u8(*val);
12333 }
12334 if matches!(version, MavlinkVersion::V2) {
12335 let len = __tmp.len();
12336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12337 } else {
12338 __tmp.len()
12339 }
12340 }
12341}
12342#[doc = "id: 146"]
12343#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
12344#[derive(Debug, Clone, PartialEq)]
12345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12347pub struct CONTROL_SYSTEM_STATE_DATA {
12348 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12349 pub time_usec: u64,
12350 #[doc = "X acceleration in body frame"]
12351 pub x_acc: f32,
12352 #[doc = "Y acceleration in body frame"]
12353 pub y_acc: f32,
12354 #[doc = "Z acceleration in body frame"]
12355 pub z_acc: f32,
12356 #[doc = "X velocity in body frame"]
12357 pub x_vel: f32,
12358 #[doc = "Y velocity in body frame"]
12359 pub y_vel: f32,
12360 #[doc = "Z velocity in body frame"]
12361 pub z_vel: f32,
12362 #[doc = "X position in local frame"]
12363 pub x_pos: f32,
12364 #[doc = "Y position in local frame"]
12365 pub y_pos: f32,
12366 #[doc = "Z position in local frame"]
12367 pub z_pos: f32,
12368 #[doc = "Airspeed, set to -1 if unknown"]
12369 pub airspeed: f32,
12370 #[doc = "Variance of body velocity estimate"]
12371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12372 pub vel_variance: [f32; 3],
12373 #[doc = "Variance in local position"]
12374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12375 pub pos_variance: [f32; 3],
12376 #[doc = "The attitude, represented as Quaternion"]
12377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12378 pub q: [f32; 4],
12379 #[doc = "Angular rate in roll axis"]
12380 pub roll_rate: f32,
12381 #[doc = "Angular rate in pitch axis"]
12382 pub pitch_rate: f32,
12383 #[doc = "Angular rate in yaw axis"]
12384 pub yaw_rate: f32,
12385}
12386impl CONTROL_SYSTEM_STATE_DATA {
12387 pub const ENCODED_LEN: usize = 100usize;
12388 pub const DEFAULT: Self = Self {
12389 time_usec: 0_u64,
12390 x_acc: 0.0_f32,
12391 y_acc: 0.0_f32,
12392 z_acc: 0.0_f32,
12393 x_vel: 0.0_f32,
12394 y_vel: 0.0_f32,
12395 z_vel: 0.0_f32,
12396 x_pos: 0.0_f32,
12397 y_pos: 0.0_f32,
12398 z_pos: 0.0_f32,
12399 airspeed: 0.0_f32,
12400 vel_variance: [0.0_f32; 3usize],
12401 pos_variance: [0.0_f32; 3usize],
12402 q: [0.0_f32; 4usize],
12403 roll_rate: 0.0_f32,
12404 pitch_rate: 0.0_f32,
12405 yaw_rate: 0.0_f32,
12406 };
12407 #[cfg(feature = "arbitrary")]
12408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12409 use arbitrary::{Arbitrary, Unstructured};
12410 let mut buf = [0u8; 1024];
12411 rng.fill_bytes(&mut buf);
12412 let mut unstructured = Unstructured::new(&buf);
12413 Self::arbitrary(&mut unstructured).unwrap_or_default()
12414 }
12415}
12416impl Default for CONTROL_SYSTEM_STATE_DATA {
12417 fn default() -> Self {
12418 Self::DEFAULT.clone()
12419 }
12420}
12421impl MessageData for CONTROL_SYSTEM_STATE_DATA {
12422 type Message = MavMessage;
12423 const ID: u32 = 146u32;
12424 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
12425 const EXTRA_CRC: u8 = 103u8;
12426 const ENCODED_LEN: usize = 100usize;
12427 fn deser(
12428 _version: MavlinkVersion,
12429 __input: &[u8],
12430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12431 let avail_len = __input.len();
12432 let mut payload_buf = [0; Self::ENCODED_LEN];
12433 let mut buf = if avail_len < Self::ENCODED_LEN {
12434 payload_buf[0..avail_len].copy_from_slice(__input);
12435 Bytes::new(&payload_buf)
12436 } else {
12437 Bytes::new(__input)
12438 };
12439 let mut __struct = Self::default();
12440 __struct.time_usec = buf.get_u64_le();
12441 __struct.x_acc = buf.get_f32_le();
12442 __struct.y_acc = buf.get_f32_le();
12443 __struct.z_acc = buf.get_f32_le();
12444 __struct.x_vel = buf.get_f32_le();
12445 __struct.y_vel = buf.get_f32_le();
12446 __struct.z_vel = buf.get_f32_le();
12447 __struct.x_pos = buf.get_f32_le();
12448 __struct.y_pos = buf.get_f32_le();
12449 __struct.z_pos = buf.get_f32_le();
12450 __struct.airspeed = buf.get_f32_le();
12451 for v in &mut __struct.vel_variance {
12452 let val = buf.get_f32_le();
12453 *v = val;
12454 }
12455 for v in &mut __struct.pos_variance {
12456 let val = buf.get_f32_le();
12457 *v = val;
12458 }
12459 for v in &mut __struct.q {
12460 let val = buf.get_f32_le();
12461 *v = val;
12462 }
12463 __struct.roll_rate = buf.get_f32_le();
12464 __struct.pitch_rate = buf.get_f32_le();
12465 __struct.yaw_rate = buf.get_f32_le();
12466 Ok(__struct)
12467 }
12468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12469 let mut __tmp = BytesMut::new(bytes);
12470 #[allow(clippy::absurd_extreme_comparisons)]
12471 #[allow(unused_comparisons)]
12472 if __tmp.remaining() < Self::ENCODED_LEN {
12473 panic!(
12474 "buffer is too small (need {} bytes, but got {})",
12475 Self::ENCODED_LEN,
12476 __tmp.remaining(),
12477 )
12478 }
12479 __tmp.put_u64_le(self.time_usec);
12480 __tmp.put_f32_le(self.x_acc);
12481 __tmp.put_f32_le(self.y_acc);
12482 __tmp.put_f32_le(self.z_acc);
12483 __tmp.put_f32_le(self.x_vel);
12484 __tmp.put_f32_le(self.y_vel);
12485 __tmp.put_f32_le(self.z_vel);
12486 __tmp.put_f32_le(self.x_pos);
12487 __tmp.put_f32_le(self.y_pos);
12488 __tmp.put_f32_le(self.z_pos);
12489 __tmp.put_f32_le(self.airspeed);
12490 for val in &self.vel_variance {
12491 __tmp.put_f32_le(*val);
12492 }
12493 for val in &self.pos_variance {
12494 __tmp.put_f32_le(*val);
12495 }
12496 for val in &self.q {
12497 __tmp.put_f32_le(*val);
12498 }
12499 __tmp.put_f32_le(self.roll_rate);
12500 __tmp.put_f32_le(self.pitch_rate);
12501 __tmp.put_f32_le(self.yaw_rate);
12502 if matches!(version, MavlinkVersion::V2) {
12503 let len = __tmp.len();
12504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12505 } else {
12506 __tmp.len()
12507 }
12508 }
12509}
12510#[doc = "id: 50005"]
12511#[doc = "offset response to encapsulated data."]
12512#[derive(Debug, Clone, PartialEq)]
12513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12515pub struct CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
12516 #[doc = "FW Offset."]
12517 pub offset: u32,
12518 #[doc = "System ID."]
12519 pub target_system: u8,
12520 #[doc = "Component ID."]
12521 pub target_component: u8,
12522}
12523impl CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
12524 pub const ENCODED_LEN: usize = 6usize;
12525 pub const DEFAULT: Self = Self {
12526 offset: 0_u32,
12527 target_system: 0_u8,
12528 target_component: 0_u8,
12529 };
12530 #[cfg(feature = "arbitrary")]
12531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12532 use arbitrary::{Arbitrary, Unstructured};
12533 let mut buf = [0u8; 1024];
12534 rng.fill_bytes(&mut buf);
12535 let mut unstructured = Unstructured::new(&buf);
12536 Self::arbitrary(&mut unstructured).unwrap_or_default()
12537 }
12538}
12539impl Default for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
12540 fn default() -> Self {
12541 Self::DEFAULT.clone()
12542 }
12543}
12544impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA {
12545 type Message = MavMessage;
12546 const ID: u32 = 50005u32;
12547 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_RESP";
12548 const EXTRA_CRC: u8 = 152u8;
12549 const ENCODED_LEN: usize = 6usize;
12550 fn deser(
12551 _version: MavlinkVersion,
12552 __input: &[u8],
12553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12554 let avail_len = __input.len();
12555 let mut payload_buf = [0; Self::ENCODED_LEN];
12556 let mut buf = if avail_len < Self::ENCODED_LEN {
12557 payload_buf[0..avail_len].copy_from_slice(__input);
12558 Bytes::new(&payload_buf)
12559 } else {
12560 Bytes::new(__input)
12561 };
12562 let mut __struct = Self::default();
12563 __struct.offset = buf.get_u32_le();
12564 __struct.target_system = buf.get_u8();
12565 __struct.target_component = buf.get_u8();
12566 Ok(__struct)
12567 }
12568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12569 let mut __tmp = BytesMut::new(bytes);
12570 #[allow(clippy::absurd_extreme_comparisons)]
12571 #[allow(unused_comparisons)]
12572 if __tmp.remaining() < Self::ENCODED_LEN {
12573 panic!(
12574 "buffer is too small (need {} bytes, but got {})",
12575 Self::ENCODED_LEN,
12576 __tmp.remaining(),
12577 )
12578 }
12579 __tmp.put_u32_le(self.offset);
12580 __tmp.put_u8(self.target_system);
12581 __tmp.put_u8(self.target_component);
12582 if matches!(version, MavlinkVersion::V2) {
12583 let len = __tmp.len();
12584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12585 } else {
12586 __tmp.len()
12587 }
12588 }
12589}
12590#[doc = "id: 50004"]
12591#[doc = "Start firmware update with encapsulated data."]
12592#[derive(Debug, Clone, PartialEq)]
12593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12595pub struct CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
12596 #[doc = "FW Size."]
12597 pub size: u32,
12598 #[doc = "FW CRC."]
12599 pub crc: u32,
12600 #[doc = "System ID."]
12601 pub target_system: u8,
12602 #[doc = "Component ID."]
12603 pub target_component: u8,
12604}
12605impl CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
12606 pub const ENCODED_LEN: usize = 10usize;
12607 pub const DEFAULT: Self = Self {
12608 size: 0_u32,
12609 crc: 0_u32,
12610 target_system: 0_u8,
12611 target_component: 0_u8,
12612 };
12613 #[cfg(feature = "arbitrary")]
12614 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12615 use arbitrary::{Arbitrary, Unstructured};
12616 let mut buf = [0u8; 1024];
12617 rng.fill_bytes(&mut buf);
12618 let mut unstructured = Unstructured::new(&buf);
12619 Self::arbitrary(&mut unstructured).unwrap_or_default()
12620 }
12621}
12622impl Default for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
12623 fn default() -> Self {
12624 Self::DEFAULT.clone()
12625 }
12626}
12627impl MessageData for CUBEPILOT_FIRMWARE_UPDATE_START_DATA {
12628 type Message = MavMessage;
12629 const ID: u32 = 50004u32;
12630 const NAME: &'static str = "CUBEPILOT_FIRMWARE_UPDATE_START";
12631 const EXTRA_CRC: u8 = 240u8;
12632 const ENCODED_LEN: usize = 10usize;
12633 fn deser(
12634 _version: MavlinkVersion,
12635 __input: &[u8],
12636 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12637 let avail_len = __input.len();
12638 let mut payload_buf = [0; Self::ENCODED_LEN];
12639 let mut buf = if avail_len < Self::ENCODED_LEN {
12640 payload_buf[0..avail_len].copy_from_slice(__input);
12641 Bytes::new(&payload_buf)
12642 } else {
12643 Bytes::new(__input)
12644 };
12645 let mut __struct = Self::default();
12646 __struct.size = buf.get_u32_le();
12647 __struct.crc = buf.get_u32_le();
12648 __struct.target_system = buf.get_u8();
12649 __struct.target_component = buf.get_u8();
12650 Ok(__struct)
12651 }
12652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12653 let mut __tmp = BytesMut::new(bytes);
12654 #[allow(clippy::absurd_extreme_comparisons)]
12655 #[allow(unused_comparisons)]
12656 if __tmp.remaining() < Self::ENCODED_LEN {
12657 panic!(
12658 "buffer is too small (need {} bytes, but got {})",
12659 Self::ENCODED_LEN,
12660 __tmp.remaining(),
12661 )
12662 }
12663 __tmp.put_u32_le(self.size);
12664 __tmp.put_u32_le(self.crc);
12665 __tmp.put_u8(self.target_system);
12666 __tmp.put_u8(self.target_component);
12667 if matches!(version, MavlinkVersion::V2) {
12668 let len = __tmp.len();
12669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12670 } else {
12671 __tmp.len()
12672 }
12673 }
12674}
12675#[doc = "id: 50001"]
12676#[doc = "Raw RC Data."]
12677#[derive(Debug, Clone, PartialEq)]
12678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12680pub struct CUBEPILOT_RAW_RC_DATA {
12681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12682 pub rc_raw: [u8; 32],
12683}
12684impl CUBEPILOT_RAW_RC_DATA {
12685 pub const ENCODED_LEN: usize = 32usize;
12686 pub const DEFAULT: Self = Self {
12687 rc_raw: [0_u8; 32usize],
12688 };
12689 #[cfg(feature = "arbitrary")]
12690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12691 use arbitrary::{Arbitrary, Unstructured};
12692 let mut buf = [0u8; 1024];
12693 rng.fill_bytes(&mut buf);
12694 let mut unstructured = Unstructured::new(&buf);
12695 Self::arbitrary(&mut unstructured).unwrap_or_default()
12696 }
12697}
12698impl Default for CUBEPILOT_RAW_RC_DATA {
12699 fn default() -> Self {
12700 Self::DEFAULT.clone()
12701 }
12702}
12703impl MessageData for CUBEPILOT_RAW_RC_DATA {
12704 type Message = MavMessage;
12705 const ID: u32 = 50001u32;
12706 const NAME: &'static str = "CUBEPILOT_RAW_RC";
12707 const EXTRA_CRC: u8 = 246u8;
12708 const ENCODED_LEN: usize = 32usize;
12709 fn deser(
12710 _version: MavlinkVersion,
12711 __input: &[u8],
12712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12713 let avail_len = __input.len();
12714 let mut payload_buf = [0; Self::ENCODED_LEN];
12715 let mut buf = if avail_len < Self::ENCODED_LEN {
12716 payload_buf[0..avail_len].copy_from_slice(__input);
12717 Bytes::new(&payload_buf)
12718 } else {
12719 Bytes::new(__input)
12720 };
12721 let mut __struct = Self::default();
12722 for v in &mut __struct.rc_raw {
12723 let val = buf.get_u8();
12724 *v = val;
12725 }
12726 Ok(__struct)
12727 }
12728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12729 let mut __tmp = BytesMut::new(bytes);
12730 #[allow(clippy::absurd_extreme_comparisons)]
12731 #[allow(unused_comparisons)]
12732 if __tmp.remaining() < Self::ENCODED_LEN {
12733 panic!(
12734 "buffer is too small (need {} bytes, but got {})",
12735 Self::ENCODED_LEN,
12736 __tmp.remaining(),
12737 )
12738 }
12739 for val in &self.rc_raw {
12740 __tmp.put_u8(*val);
12741 }
12742 if matches!(version, MavlinkVersion::V2) {
12743 let len = __tmp.len();
12744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12745 } else {
12746 __tmp.len()
12747 }
12748 }
12749}
12750#[doc = "id: 411"]
12751#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
12752#[derive(Debug, Clone, PartialEq)]
12753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12755pub struct CURRENT_EVENT_SEQUENCE_DATA {
12756 #[doc = "Sequence number."]
12757 pub sequence: u16,
12758 #[doc = "Flag bitset."]
12759 pub flags: MavEventCurrentSequenceFlags,
12760}
12761impl CURRENT_EVENT_SEQUENCE_DATA {
12762 pub const ENCODED_LEN: usize = 3usize;
12763 pub const DEFAULT: Self = Self {
12764 sequence: 0_u16,
12765 flags: MavEventCurrentSequenceFlags::DEFAULT,
12766 };
12767 #[cfg(feature = "arbitrary")]
12768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12769 use arbitrary::{Arbitrary, Unstructured};
12770 let mut buf = [0u8; 1024];
12771 rng.fill_bytes(&mut buf);
12772 let mut unstructured = Unstructured::new(&buf);
12773 Self::arbitrary(&mut unstructured).unwrap_or_default()
12774 }
12775}
12776impl Default for CURRENT_EVENT_SEQUENCE_DATA {
12777 fn default() -> Self {
12778 Self::DEFAULT.clone()
12779 }
12780}
12781impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
12782 type Message = MavMessage;
12783 const ID: u32 = 411u32;
12784 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
12785 const EXTRA_CRC: u8 = 106u8;
12786 const ENCODED_LEN: usize = 3usize;
12787 fn deser(
12788 _version: MavlinkVersion,
12789 __input: &[u8],
12790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12791 let avail_len = __input.len();
12792 let mut payload_buf = [0; Self::ENCODED_LEN];
12793 let mut buf = if avail_len < Self::ENCODED_LEN {
12794 payload_buf[0..avail_len].copy_from_slice(__input);
12795 Bytes::new(&payload_buf)
12796 } else {
12797 Bytes::new(__input)
12798 };
12799 let mut __struct = Self::default();
12800 __struct.sequence = buf.get_u16_le();
12801 let tmp = buf.get_u8();
12802 __struct.flags =
12803 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12804 enum_type: "MavEventCurrentSequenceFlags",
12805 value: tmp as u32,
12806 })?;
12807 Ok(__struct)
12808 }
12809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12810 let mut __tmp = BytesMut::new(bytes);
12811 #[allow(clippy::absurd_extreme_comparisons)]
12812 #[allow(unused_comparisons)]
12813 if __tmp.remaining() < Self::ENCODED_LEN {
12814 panic!(
12815 "buffer is too small (need {} bytes, but got {})",
12816 Self::ENCODED_LEN,
12817 __tmp.remaining(),
12818 )
12819 }
12820 __tmp.put_u16_le(self.sequence);
12821 __tmp.put_u8(self.flags as u8);
12822 if matches!(version, MavlinkVersion::V2) {
12823 let len = __tmp.len();
12824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12825 } else {
12826 __tmp.len()
12827 }
12828 }
12829}
12830#[doc = "id: 436"]
12831#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
12832#[derive(Debug, Clone, PartialEq)]
12833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12835pub struct CURRENT_MODE_DATA {
12836 #[doc = "A bitfield for use for autopilot-specific flags"]
12837 pub custom_mode: u32,
12838 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
12839 pub intended_custom_mode: u32,
12840 #[doc = "Standard mode."]
12841 pub standard_mode: MavStandardMode,
12842}
12843impl CURRENT_MODE_DATA {
12844 pub const ENCODED_LEN: usize = 9usize;
12845 pub const DEFAULT: Self = Self {
12846 custom_mode: 0_u32,
12847 intended_custom_mode: 0_u32,
12848 standard_mode: MavStandardMode::DEFAULT,
12849 };
12850 #[cfg(feature = "arbitrary")]
12851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12852 use arbitrary::{Arbitrary, Unstructured};
12853 let mut buf = [0u8; 1024];
12854 rng.fill_bytes(&mut buf);
12855 let mut unstructured = Unstructured::new(&buf);
12856 Self::arbitrary(&mut unstructured).unwrap_or_default()
12857 }
12858}
12859impl Default for CURRENT_MODE_DATA {
12860 fn default() -> Self {
12861 Self::DEFAULT.clone()
12862 }
12863}
12864impl MessageData for CURRENT_MODE_DATA {
12865 type Message = MavMessage;
12866 const ID: u32 = 436u32;
12867 const NAME: &'static str = "CURRENT_MODE";
12868 const EXTRA_CRC: u8 = 193u8;
12869 const ENCODED_LEN: usize = 9usize;
12870 fn deser(
12871 _version: MavlinkVersion,
12872 __input: &[u8],
12873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12874 let avail_len = __input.len();
12875 let mut payload_buf = [0; Self::ENCODED_LEN];
12876 let mut buf = if avail_len < Self::ENCODED_LEN {
12877 payload_buf[0..avail_len].copy_from_slice(__input);
12878 Bytes::new(&payload_buf)
12879 } else {
12880 Bytes::new(__input)
12881 };
12882 let mut __struct = Self::default();
12883 __struct.custom_mode = buf.get_u32_le();
12884 __struct.intended_custom_mode = buf.get_u32_le();
12885 let tmp = buf.get_u8();
12886 __struct.standard_mode =
12887 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12888 enum_type: "MavStandardMode",
12889 value: tmp as u32,
12890 })?;
12891 Ok(__struct)
12892 }
12893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12894 let mut __tmp = BytesMut::new(bytes);
12895 #[allow(clippy::absurd_extreme_comparisons)]
12896 #[allow(unused_comparisons)]
12897 if __tmp.remaining() < Self::ENCODED_LEN {
12898 panic!(
12899 "buffer is too small (need {} bytes, but got {})",
12900 Self::ENCODED_LEN,
12901 __tmp.remaining(),
12902 )
12903 }
12904 __tmp.put_u32_le(self.custom_mode);
12905 __tmp.put_u32_le(self.intended_custom_mode);
12906 __tmp.put_u8(self.standard_mode as u8);
12907 if matches!(version, MavlinkVersion::V2) {
12908 let len = __tmp.len();
12909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12910 } else {
12911 __tmp.len()
12912 }
12913 }
12914}
12915#[doc = "id: 169"]
12916#[doc = "Data packet, size 16."]
12917#[derive(Debug, Clone, PartialEq)]
12918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12920pub struct DATA16_DATA {
12921 #[doc = "Data type."]
12922 pub mavtype: u8,
12923 #[doc = "Data length."]
12924 pub len: u8,
12925 #[doc = "Raw data."]
12926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12927 pub data: [u8; 16],
12928}
12929impl DATA16_DATA {
12930 pub const ENCODED_LEN: usize = 18usize;
12931 pub const DEFAULT: Self = Self {
12932 mavtype: 0_u8,
12933 len: 0_u8,
12934 data: [0_u8; 16usize],
12935 };
12936 #[cfg(feature = "arbitrary")]
12937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12938 use arbitrary::{Arbitrary, Unstructured};
12939 let mut buf = [0u8; 1024];
12940 rng.fill_bytes(&mut buf);
12941 let mut unstructured = Unstructured::new(&buf);
12942 Self::arbitrary(&mut unstructured).unwrap_or_default()
12943 }
12944}
12945impl Default for DATA16_DATA {
12946 fn default() -> Self {
12947 Self::DEFAULT.clone()
12948 }
12949}
12950impl MessageData for DATA16_DATA {
12951 type Message = MavMessage;
12952 const ID: u32 = 169u32;
12953 const NAME: &'static str = "DATA16";
12954 const EXTRA_CRC: u8 = 234u8;
12955 const ENCODED_LEN: usize = 18usize;
12956 fn deser(
12957 _version: MavlinkVersion,
12958 __input: &[u8],
12959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12960 let avail_len = __input.len();
12961 let mut payload_buf = [0; Self::ENCODED_LEN];
12962 let mut buf = if avail_len < Self::ENCODED_LEN {
12963 payload_buf[0..avail_len].copy_from_slice(__input);
12964 Bytes::new(&payload_buf)
12965 } else {
12966 Bytes::new(__input)
12967 };
12968 let mut __struct = Self::default();
12969 __struct.mavtype = buf.get_u8();
12970 __struct.len = buf.get_u8();
12971 for v in &mut __struct.data {
12972 let val = buf.get_u8();
12973 *v = val;
12974 }
12975 Ok(__struct)
12976 }
12977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12978 let mut __tmp = BytesMut::new(bytes);
12979 #[allow(clippy::absurd_extreme_comparisons)]
12980 #[allow(unused_comparisons)]
12981 if __tmp.remaining() < Self::ENCODED_LEN {
12982 panic!(
12983 "buffer is too small (need {} bytes, but got {})",
12984 Self::ENCODED_LEN,
12985 __tmp.remaining(),
12986 )
12987 }
12988 __tmp.put_u8(self.mavtype);
12989 __tmp.put_u8(self.len);
12990 for val in &self.data {
12991 __tmp.put_u8(*val);
12992 }
12993 if matches!(version, MavlinkVersion::V2) {
12994 let len = __tmp.len();
12995 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12996 } else {
12997 __tmp.len()
12998 }
12999 }
13000}
13001#[doc = "id: 170"]
13002#[doc = "Data packet, size 32."]
13003#[derive(Debug, Clone, PartialEq)]
13004#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13006pub struct DATA32_DATA {
13007 #[doc = "Data type."]
13008 pub mavtype: u8,
13009 #[doc = "Data length."]
13010 pub len: u8,
13011 #[doc = "Raw data."]
13012 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13013 pub data: [u8; 32],
13014}
13015impl DATA32_DATA {
13016 pub const ENCODED_LEN: usize = 34usize;
13017 pub const DEFAULT: Self = Self {
13018 mavtype: 0_u8,
13019 len: 0_u8,
13020 data: [0_u8; 32usize],
13021 };
13022 #[cfg(feature = "arbitrary")]
13023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13024 use arbitrary::{Arbitrary, Unstructured};
13025 let mut buf = [0u8; 1024];
13026 rng.fill_bytes(&mut buf);
13027 let mut unstructured = Unstructured::new(&buf);
13028 Self::arbitrary(&mut unstructured).unwrap_or_default()
13029 }
13030}
13031impl Default for DATA32_DATA {
13032 fn default() -> Self {
13033 Self::DEFAULT.clone()
13034 }
13035}
13036impl MessageData for DATA32_DATA {
13037 type Message = MavMessage;
13038 const ID: u32 = 170u32;
13039 const NAME: &'static str = "DATA32";
13040 const EXTRA_CRC: u8 = 73u8;
13041 const ENCODED_LEN: usize = 34usize;
13042 fn deser(
13043 _version: MavlinkVersion,
13044 __input: &[u8],
13045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13046 let avail_len = __input.len();
13047 let mut payload_buf = [0; Self::ENCODED_LEN];
13048 let mut buf = if avail_len < Self::ENCODED_LEN {
13049 payload_buf[0..avail_len].copy_from_slice(__input);
13050 Bytes::new(&payload_buf)
13051 } else {
13052 Bytes::new(__input)
13053 };
13054 let mut __struct = Self::default();
13055 __struct.mavtype = buf.get_u8();
13056 __struct.len = buf.get_u8();
13057 for v in &mut __struct.data {
13058 let val = buf.get_u8();
13059 *v = val;
13060 }
13061 Ok(__struct)
13062 }
13063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13064 let mut __tmp = BytesMut::new(bytes);
13065 #[allow(clippy::absurd_extreme_comparisons)]
13066 #[allow(unused_comparisons)]
13067 if __tmp.remaining() < Self::ENCODED_LEN {
13068 panic!(
13069 "buffer is too small (need {} bytes, but got {})",
13070 Self::ENCODED_LEN,
13071 __tmp.remaining(),
13072 )
13073 }
13074 __tmp.put_u8(self.mavtype);
13075 __tmp.put_u8(self.len);
13076 for val in &self.data {
13077 __tmp.put_u8(*val);
13078 }
13079 if matches!(version, MavlinkVersion::V2) {
13080 let len = __tmp.len();
13081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13082 } else {
13083 __tmp.len()
13084 }
13085 }
13086}
13087#[doc = "id: 171"]
13088#[doc = "Data packet, size 64."]
13089#[derive(Debug, Clone, PartialEq)]
13090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13092pub struct DATA64_DATA {
13093 #[doc = "Data type."]
13094 pub mavtype: u8,
13095 #[doc = "Data length."]
13096 pub len: u8,
13097 #[doc = "Raw data."]
13098 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13099 pub data: [u8; 64],
13100}
13101impl DATA64_DATA {
13102 pub const ENCODED_LEN: usize = 66usize;
13103 pub const DEFAULT: Self = Self {
13104 mavtype: 0_u8,
13105 len: 0_u8,
13106 data: [0_u8; 64usize],
13107 };
13108 #[cfg(feature = "arbitrary")]
13109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13110 use arbitrary::{Arbitrary, Unstructured};
13111 let mut buf = [0u8; 1024];
13112 rng.fill_bytes(&mut buf);
13113 let mut unstructured = Unstructured::new(&buf);
13114 Self::arbitrary(&mut unstructured).unwrap_or_default()
13115 }
13116}
13117impl Default for DATA64_DATA {
13118 fn default() -> Self {
13119 Self::DEFAULT.clone()
13120 }
13121}
13122impl MessageData for DATA64_DATA {
13123 type Message = MavMessage;
13124 const ID: u32 = 171u32;
13125 const NAME: &'static str = "DATA64";
13126 const EXTRA_CRC: u8 = 181u8;
13127 const ENCODED_LEN: usize = 66usize;
13128 fn deser(
13129 _version: MavlinkVersion,
13130 __input: &[u8],
13131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13132 let avail_len = __input.len();
13133 let mut payload_buf = [0; Self::ENCODED_LEN];
13134 let mut buf = if avail_len < Self::ENCODED_LEN {
13135 payload_buf[0..avail_len].copy_from_slice(__input);
13136 Bytes::new(&payload_buf)
13137 } else {
13138 Bytes::new(__input)
13139 };
13140 let mut __struct = Self::default();
13141 __struct.mavtype = buf.get_u8();
13142 __struct.len = buf.get_u8();
13143 for v in &mut __struct.data {
13144 let val = buf.get_u8();
13145 *v = val;
13146 }
13147 Ok(__struct)
13148 }
13149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13150 let mut __tmp = BytesMut::new(bytes);
13151 #[allow(clippy::absurd_extreme_comparisons)]
13152 #[allow(unused_comparisons)]
13153 if __tmp.remaining() < Self::ENCODED_LEN {
13154 panic!(
13155 "buffer is too small (need {} bytes, but got {})",
13156 Self::ENCODED_LEN,
13157 __tmp.remaining(),
13158 )
13159 }
13160 __tmp.put_u8(self.mavtype);
13161 __tmp.put_u8(self.len);
13162 for val in &self.data {
13163 __tmp.put_u8(*val);
13164 }
13165 if matches!(version, MavlinkVersion::V2) {
13166 let len = __tmp.len();
13167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13168 } else {
13169 __tmp.len()
13170 }
13171 }
13172}
13173#[doc = "id: 172"]
13174#[doc = "Data packet, size 96."]
13175#[derive(Debug, Clone, PartialEq)]
13176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13178pub struct DATA96_DATA {
13179 #[doc = "Data type."]
13180 pub mavtype: u8,
13181 #[doc = "Data length."]
13182 pub len: u8,
13183 #[doc = "Raw data."]
13184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13185 pub data: [u8; 96],
13186}
13187impl DATA96_DATA {
13188 pub const ENCODED_LEN: usize = 98usize;
13189 pub const DEFAULT: Self = Self {
13190 mavtype: 0_u8,
13191 len: 0_u8,
13192 data: [0_u8; 96usize],
13193 };
13194 #[cfg(feature = "arbitrary")]
13195 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13196 use arbitrary::{Arbitrary, Unstructured};
13197 let mut buf = [0u8; 1024];
13198 rng.fill_bytes(&mut buf);
13199 let mut unstructured = Unstructured::new(&buf);
13200 Self::arbitrary(&mut unstructured).unwrap_or_default()
13201 }
13202}
13203impl Default for DATA96_DATA {
13204 fn default() -> Self {
13205 Self::DEFAULT.clone()
13206 }
13207}
13208impl MessageData for DATA96_DATA {
13209 type Message = MavMessage;
13210 const ID: u32 = 172u32;
13211 const NAME: &'static str = "DATA96";
13212 const EXTRA_CRC: u8 = 22u8;
13213 const ENCODED_LEN: usize = 98usize;
13214 fn deser(
13215 _version: MavlinkVersion,
13216 __input: &[u8],
13217 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13218 let avail_len = __input.len();
13219 let mut payload_buf = [0; Self::ENCODED_LEN];
13220 let mut buf = if avail_len < Self::ENCODED_LEN {
13221 payload_buf[0..avail_len].copy_from_slice(__input);
13222 Bytes::new(&payload_buf)
13223 } else {
13224 Bytes::new(__input)
13225 };
13226 let mut __struct = Self::default();
13227 __struct.mavtype = buf.get_u8();
13228 __struct.len = buf.get_u8();
13229 for v in &mut __struct.data {
13230 let val = buf.get_u8();
13231 *v = val;
13232 }
13233 Ok(__struct)
13234 }
13235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13236 let mut __tmp = BytesMut::new(bytes);
13237 #[allow(clippy::absurd_extreme_comparisons)]
13238 #[allow(unused_comparisons)]
13239 if __tmp.remaining() < Self::ENCODED_LEN {
13240 panic!(
13241 "buffer is too small (need {} bytes, but got {})",
13242 Self::ENCODED_LEN,
13243 __tmp.remaining(),
13244 )
13245 }
13246 __tmp.put_u8(self.mavtype);
13247 __tmp.put_u8(self.len);
13248 for val in &self.data {
13249 __tmp.put_u8(*val);
13250 }
13251 if matches!(version, MavlinkVersion::V2) {
13252 let len = __tmp.len();
13253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13254 } else {
13255 __tmp.len()
13256 }
13257 }
13258}
13259#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
13260#[doc = "id: 67"]
13261#[doc = "Data stream status information."]
13262#[derive(Debug, Clone, PartialEq)]
13263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13265pub struct DATA_STREAM_DATA {
13266 #[doc = "The message rate"]
13267 pub message_rate: u16,
13268 #[doc = "The ID of the requested data stream"]
13269 pub stream_id: u8,
13270 #[doc = "1 stream is enabled, 0 stream is stopped."]
13271 pub on_off: u8,
13272}
13273impl DATA_STREAM_DATA {
13274 pub const ENCODED_LEN: usize = 4usize;
13275 pub const DEFAULT: Self = Self {
13276 message_rate: 0_u16,
13277 stream_id: 0_u8,
13278 on_off: 0_u8,
13279 };
13280 #[cfg(feature = "arbitrary")]
13281 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13282 use arbitrary::{Arbitrary, Unstructured};
13283 let mut buf = [0u8; 1024];
13284 rng.fill_bytes(&mut buf);
13285 let mut unstructured = Unstructured::new(&buf);
13286 Self::arbitrary(&mut unstructured).unwrap_or_default()
13287 }
13288}
13289impl Default for DATA_STREAM_DATA {
13290 fn default() -> Self {
13291 Self::DEFAULT.clone()
13292 }
13293}
13294impl MessageData for DATA_STREAM_DATA {
13295 type Message = MavMessage;
13296 const ID: u32 = 67u32;
13297 const NAME: &'static str = "DATA_STREAM";
13298 const EXTRA_CRC: u8 = 21u8;
13299 const ENCODED_LEN: usize = 4usize;
13300 fn deser(
13301 _version: MavlinkVersion,
13302 __input: &[u8],
13303 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13304 let avail_len = __input.len();
13305 let mut payload_buf = [0; Self::ENCODED_LEN];
13306 let mut buf = if avail_len < Self::ENCODED_LEN {
13307 payload_buf[0..avail_len].copy_from_slice(__input);
13308 Bytes::new(&payload_buf)
13309 } else {
13310 Bytes::new(__input)
13311 };
13312 let mut __struct = Self::default();
13313 __struct.message_rate = buf.get_u16_le();
13314 __struct.stream_id = buf.get_u8();
13315 __struct.on_off = buf.get_u8();
13316 Ok(__struct)
13317 }
13318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13319 let mut __tmp = BytesMut::new(bytes);
13320 #[allow(clippy::absurd_extreme_comparisons)]
13321 #[allow(unused_comparisons)]
13322 if __tmp.remaining() < Self::ENCODED_LEN {
13323 panic!(
13324 "buffer is too small (need {} bytes, but got {})",
13325 Self::ENCODED_LEN,
13326 __tmp.remaining(),
13327 )
13328 }
13329 __tmp.put_u16_le(self.message_rate);
13330 __tmp.put_u8(self.stream_id);
13331 __tmp.put_u8(self.on_off);
13332 if matches!(version, MavlinkVersion::V2) {
13333 let len = __tmp.len();
13334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13335 } else {
13336 __tmp.len()
13337 }
13338 }
13339}
13340#[doc = "id: 130"]
13341#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
13342#[derive(Debug, Clone, PartialEq)]
13343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13345pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
13346 #[doc = "total data size (set on ACK only)."]
13347 pub size: u32,
13348 #[doc = "Width of a matrix or image."]
13349 pub width: u16,
13350 #[doc = "Height of a matrix or image."]
13351 pub height: u16,
13352 #[doc = "Number of packets being sent (set on ACK only)."]
13353 pub packets: u16,
13354 #[doc = "Type of requested/acknowledged data."]
13355 pub mavtype: MavlinkDataStreamType,
13356 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
13357 pub payload: u8,
13358 #[doc = "JPEG quality. Values: [1-100]."]
13359 pub jpg_quality: u8,
13360}
13361impl DATA_TRANSMISSION_HANDSHAKE_DATA {
13362 pub const ENCODED_LEN: usize = 13usize;
13363 pub const DEFAULT: Self = Self {
13364 size: 0_u32,
13365 width: 0_u16,
13366 height: 0_u16,
13367 packets: 0_u16,
13368 mavtype: MavlinkDataStreamType::DEFAULT,
13369 payload: 0_u8,
13370 jpg_quality: 0_u8,
13371 };
13372 #[cfg(feature = "arbitrary")]
13373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13374 use arbitrary::{Arbitrary, Unstructured};
13375 let mut buf = [0u8; 1024];
13376 rng.fill_bytes(&mut buf);
13377 let mut unstructured = Unstructured::new(&buf);
13378 Self::arbitrary(&mut unstructured).unwrap_or_default()
13379 }
13380}
13381impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
13382 fn default() -> Self {
13383 Self::DEFAULT.clone()
13384 }
13385}
13386impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
13387 type Message = MavMessage;
13388 const ID: u32 = 130u32;
13389 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
13390 const EXTRA_CRC: u8 = 29u8;
13391 const ENCODED_LEN: usize = 13usize;
13392 fn deser(
13393 _version: MavlinkVersion,
13394 __input: &[u8],
13395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13396 let avail_len = __input.len();
13397 let mut payload_buf = [0; Self::ENCODED_LEN];
13398 let mut buf = if avail_len < Self::ENCODED_LEN {
13399 payload_buf[0..avail_len].copy_from_slice(__input);
13400 Bytes::new(&payload_buf)
13401 } else {
13402 Bytes::new(__input)
13403 };
13404 let mut __struct = Self::default();
13405 __struct.size = buf.get_u32_le();
13406 __struct.width = buf.get_u16_le();
13407 __struct.height = buf.get_u16_le();
13408 __struct.packets = buf.get_u16_le();
13409 let tmp = buf.get_u8();
13410 __struct.mavtype =
13411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13412 enum_type: "MavlinkDataStreamType",
13413 value: tmp as u32,
13414 })?;
13415 __struct.payload = buf.get_u8();
13416 __struct.jpg_quality = buf.get_u8();
13417 Ok(__struct)
13418 }
13419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13420 let mut __tmp = BytesMut::new(bytes);
13421 #[allow(clippy::absurd_extreme_comparisons)]
13422 #[allow(unused_comparisons)]
13423 if __tmp.remaining() < Self::ENCODED_LEN {
13424 panic!(
13425 "buffer is too small (need {} bytes, but got {})",
13426 Self::ENCODED_LEN,
13427 __tmp.remaining(),
13428 )
13429 }
13430 __tmp.put_u32_le(self.size);
13431 __tmp.put_u16_le(self.width);
13432 __tmp.put_u16_le(self.height);
13433 __tmp.put_u16_le(self.packets);
13434 __tmp.put_u8(self.mavtype as u8);
13435 __tmp.put_u8(self.payload);
13436 __tmp.put_u8(self.jpg_quality);
13437 if matches!(version, MavlinkVersion::V2) {
13438 let len = __tmp.len();
13439 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13440 } else {
13441 __tmp.len()
13442 }
13443 }
13444}
13445#[doc = "id: 254"]
13446#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
13447#[derive(Debug, Clone, PartialEq)]
13448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13450pub struct DEBUG_DATA {
13451 #[doc = "Timestamp (time since system boot)."]
13452 pub time_boot_ms: u32,
13453 #[doc = "DEBUG value"]
13454 pub value: f32,
13455 #[doc = "index of debug variable"]
13456 pub ind: u8,
13457}
13458impl DEBUG_DATA {
13459 pub const ENCODED_LEN: usize = 9usize;
13460 pub const DEFAULT: Self = Self {
13461 time_boot_ms: 0_u32,
13462 value: 0.0_f32,
13463 ind: 0_u8,
13464 };
13465 #[cfg(feature = "arbitrary")]
13466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13467 use arbitrary::{Arbitrary, Unstructured};
13468 let mut buf = [0u8; 1024];
13469 rng.fill_bytes(&mut buf);
13470 let mut unstructured = Unstructured::new(&buf);
13471 Self::arbitrary(&mut unstructured).unwrap_or_default()
13472 }
13473}
13474impl Default for DEBUG_DATA {
13475 fn default() -> Self {
13476 Self::DEFAULT.clone()
13477 }
13478}
13479impl MessageData for DEBUG_DATA {
13480 type Message = MavMessage;
13481 const ID: u32 = 254u32;
13482 const NAME: &'static str = "DEBUG";
13483 const EXTRA_CRC: u8 = 46u8;
13484 const ENCODED_LEN: usize = 9usize;
13485 fn deser(
13486 _version: MavlinkVersion,
13487 __input: &[u8],
13488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13489 let avail_len = __input.len();
13490 let mut payload_buf = [0; Self::ENCODED_LEN];
13491 let mut buf = if avail_len < Self::ENCODED_LEN {
13492 payload_buf[0..avail_len].copy_from_slice(__input);
13493 Bytes::new(&payload_buf)
13494 } else {
13495 Bytes::new(__input)
13496 };
13497 let mut __struct = Self::default();
13498 __struct.time_boot_ms = buf.get_u32_le();
13499 __struct.value = buf.get_f32_le();
13500 __struct.ind = buf.get_u8();
13501 Ok(__struct)
13502 }
13503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13504 let mut __tmp = BytesMut::new(bytes);
13505 #[allow(clippy::absurd_extreme_comparisons)]
13506 #[allow(unused_comparisons)]
13507 if __tmp.remaining() < Self::ENCODED_LEN {
13508 panic!(
13509 "buffer is too small (need {} bytes, but got {})",
13510 Self::ENCODED_LEN,
13511 __tmp.remaining(),
13512 )
13513 }
13514 __tmp.put_u32_le(self.time_boot_ms);
13515 __tmp.put_f32_le(self.value);
13516 __tmp.put_u8(self.ind);
13517 if matches!(version, MavlinkVersion::V2) {
13518 let len = __tmp.len();
13519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13520 } else {
13521 __tmp.len()
13522 }
13523 }
13524}
13525#[doc = "id: 350"]
13526#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
13527#[derive(Debug, Clone, PartialEq)]
13528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13530pub struct DEBUG_FLOAT_ARRAY_DATA {
13531 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13532 pub time_usec: u64,
13533 #[doc = "Unique ID used to discriminate between arrays"]
13534 pub array_id: u16,
13535 #[doc = "Name, for human-friendly display in a Ground Control Station"]
13536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13537 pub name: [u8; 10],
13538 #[doc = "data"]
13539 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13540 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13541 pub data: [f32; 58],
13542}
13543impl DEBUG_FLOAT_ARRAY_DATA {
13544 pub const ENCODED_LEN: usize = 252usize;
13545 pub const DEFAULT: Self = Self {
13546 time_usec: 0_u64,
13547 array_id: 0_u16,
13548 name: [0_u8; 10usize],
13549 data: [0.0_f32; 58usize],
13550 };
13551 #[cfg(feature = "arbitrary")]
13552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13553 use arbitrary::{Arbitrary, Unstructured};
13554 let mut buf = [0u8; 1024];
13555 rng.fill_bytes(&mut buf);
13556 let mut unstructured = Unstructured::new(&buf);
13557 Self::arbitrary(&mut unstructured).unwrap_or_default()
13558 }
13559}
13560impl Default for DEBUG_FLOAT_ARRAY_DATA {
13561 fn default() -> Self {
13562 Self::DEFAULT.clone()
13563 }
13564}
13565impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
13566 type Message = MavMessage;
13567 const ID: u32 = 350u32;
13568 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
13569 const EXTRA_CRC: u8 = 232u8;
13570 const ENCODED_LEN: usize = 252usize;
13571 fn deser(
13572 _version: MavlinkVersion,
13573 __input: &[u8],
13574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13575 let avail_len = __input.len();
13576 let mut payload_buf = [0; Self::ENCODED_LEN];
13577 let mut buf = if avail_len < Self::ENCODED_LEN {
13578 payload_buf[0..avail_len].copy_from_slice(__input);
13579 Bytes::new(&payload_buf)
13580 } else {
13581 Bytes::new(__input)
13582 };
13583 let mut __struct = Self::default();
13584 __struct.time_usec = buf.get_u64_le();
13585 __struct.array_id = buf.get_u16_le();
13586 for v in &mut __struct.name {
13587 let val = buf.get_u8();
13588 *v = val;
13589 }
13590 for v in &mut __struct.data {
13591 let val = buf.get_f32_le();
13592 *v = val;
13593 }
13594 Ok(__struct)
13595 }
13596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13597 let mut __tmp = BytesMut::new(bytes);
13598 #[allow(clippy::absurd_extreme_comparisons)]
13599 #[allow(unused_comparisons)]
13600 if __tmp.remaining() < Self::ENCODED_LEN {
13601 panic!(
13602 "buffer is too small (need {} bytes, but got {})",
13603 Self::ENCODED_LEN,
13604 __tmp.remaining(),
13605 )
13606 }
13607 __tmp.put_u64_le(self.time_usec);
13608 __tmp.put_u16_le(self.array_id);
13609 for val in &self.name {
13610 __tmp.put_u8(*val);
13611 }
13612 for val in &self.data {
13613 __tmp.put_f32_le(*val);
13614 }
13615 if matches!(version, MavlinkVersion::V2) {
13616 let len = __tmp.len();
13617 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13618 } else {
13619 __tmp.len()
13620 }
13621 }
13622}
13623#[doc = "id: 250"]
13624#[doc = "To debug something using a named 3D vector."]
13625#[derive(Debug, Clone, PartialEq)]
13626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13628pub struct DEBUG_VECT_DATA {
13629 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13630 pub time_usec: u64,
13631 #[doc = "x"]
13632 pub x: f32,
13633 #[doc = "y"]
13634 pub y: f32,
13635 #[doc = "z"]
13636 pub z: f32,
13637 #[doc = "Name"]
13638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13639 pub name: [u8; 10],
13640}
13641impl DEBUG_VECT_DATA {
13642 pub const ENCODED_LEN: usize = 30usize;
13643 pub const DEFAULT: Self = Self {
13644 time_usec: 0_u64,
13645 x: 0.0_f32,
13646 y: 0.0_f32,
13647 z: 0.0_f32,
13648 name: [0_u8; 10usize],
13649 };
13650 #[cfg(feature = "arbitrary")]
13651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13652 use arbitrary::{Arbitrary, Unstructured};
13653 let mut buf = [0u8; 1024];
13654 rng.fill_bytes(&mut buf);
13655 let mut unstructured = Unstructured::new(&buf);
13656 Self::arbitrary(&mut unstructured).unwrap_or_default()
13657 }
13658}
13659impl Default for DEBUG_VECT_DATA {
13660 fn default() -> Self {
13661 Self::DEFAULT.clone()
13662 }
13663}
13664impl MessageData for DEBUG_VECT_DATA {
13665 type Message = MavMessage;
13666 const ID: u32 = 250u32;
13667 const NAME: &'static str = "DEBUG_VECT";
13668 const EXTRA_CRC: u8 = 49u8;
13669 const ENCODED_LEN: usize = 30usize;
13670 fn deser(
13671 _version: MavlinkVersion,
13672 __input: &[u8],
13673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13674 let avail_len = __input.len();
13675 let mut payload_buf = [0; Self::ENCODED_LEN];
13676 let mut buf = if avail_len < Self::ENCODED_LEN {
13677 payload_buf[0..avail_len].copy_from_slice(__input);
13678 Bytes::new(&payload_buf)
13679 } else {
13680 Bytes::new(__input)
13681 };
13682 let mut __struct = Self::default();
13683 __struct.time_usec = buf.get_u64_le();
13684 __struct.x = buf.get_f32_le();
13685 __struct.y = buf.get_f32_le();
13686 __struct.z = buf.get_f32_le();
13687 for v in &mut __struct.name {
13688 let val = buf.get_u8();
13689 *v = val;
13690 }
13691 Ok(__struct)
13692 }
13693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13694 let mut __tmp = BytesMut::new(bytes);
13695 #[allow(clippy::absurd_extreme_comparisons)]
13696 #[allow(unused_comparisons)]
13697 if __tmp.remaining() < Self::ENCODED_LEN {
13698 panic!(
13699 "buffer is too small (need {} bytes, but got {})",
13700 Self::ENCODED_LEN,
13701 __tmp.remaining(),
13702 )
13703 }
13704 __tmp.put_u64_le(self.time_usec);
13705 __tmp.put_f32_le(self.x);
13706 __tmp.put_f32_le(self.y);
13707 __tmp.put_f32_le(self.z);
13708 for val in &self.name {
13709 __tmp.put_u8(*val);
13710 }
13711 if matches!(version, MavlinkVersion::V2) {
13712 let len = __tmp.len();
13713 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13714 } else {
13715 __tmp.len()
13716 }
13717 }
13718}
13719#[doc = "id: 195"]
13720#[doc = "Deepstall path planning."]
13721#[derive(Debug, Clone, PartialEq)]
13722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13724pub struct DEEPSTALL_DATA {
13725 #[doc = "Landing latitude."]
13726 pub landing_lat: i32,
13727 #[doc = "Landing longitude."]
13728 pub landing_lon: i32,
13729 #[doc = "Final heading start point, latitude."]
13730 pub path_lat: i32,
13731 #[doc = "Final heading start point, longitude."]
13732 pub path_lon: i32,
13733 #[doc = "Arc entry point, latitude."]
13734 pub arc_entry_lat: i32,
13735 #[doc = "Arc entry point, longitude."]
13736 pub arc_entry_lon: i32,
13737 #[doc = "Altitude."]
13738 pub altitude: f32,
13739 #[doc = "Distance the aircraft expects to travel during the deepstall."]
13740 pub expected_travel_distance: f32,
13741 #[doc = "Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND)."]
13742 pub cross_track_error: f32,
13743 #[doc = "Deepstall stage."]
13744 pub stage: DeepstallStage,
13745}
13746impl DEEPSTALL_DATA {
13747 pub const ENCODED_LEN: usize = 37usize;
13748 pub const DEFAULT: Self = Self {
13749 landing_lat: 0_i32,
13750 landing_lon: 0_i32,
13751 path_lat: 0_i32,
13752 path_lon: 0_i32,
13753 arc_entry_lat: 0_i32,
13754 arc_entry_lon: 0_i32,
13755 altitude: 0.0_f32,
13756 expected_travel_distance: 0.0_f32,
13757 cross_track_error: 0.0_f32,
13758 stage: DeepstallStage::DEFAULT,
13759 };
13760 #[cfg(feature = "arbitrary")]
13761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13762 use arbitrary::{Arbitrary, Unstructured};
13763 let mut buf = [0u8; 1024];
13764 rng.fill_bytes(&mut buf);
13765 let mut unstructured = Unstructured::new(&buf);
13766 Self::arbitrary(&mut unstructured).unwrap_or_default()
13767 }
13768}
13769impl Default for DEEPSTALL_DATA {
13770 fn default() -> Self {
13771 Self::DEFAULT.clone()
13772 }
13773}
13774impl MessageData for DEEPSTALL_DATA {
13775 type Message = MavMessage;
13776 const ID: u32 = 195u32;
13777 const NAME: &'static str = "DEEPSTALL";
13778 const EXTRA_CRC: u8 = 120u8;
13779 const ENCODED_LEN: usize = 37usize;
13780 fn deser(
13781 _version: MavlinkVersion,
13782 __input: &[u8],
13783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13784 let avail_len = __input.len();
13785 let mut payload_buf = [0; Self::ENCODED_LEN];
13786 let mut buf = if avail_len < Self::ENCODED_LEN {
13787 payload_buf[0..avail_len].copy_from_slice(__input);
13788 Bytes::new(&payload_buf)
13789 } else {
13790 Bytes::new(__input)
13791 };
13792 let mut __struct = Self::default();
13793 __struct.landing_lat = buf.get_i32_le();
13794 __struct.landing_lon = buf.get_i32_le();
13795 __struct.path_lat = buf.get_i32_le();
13796 __struct.path_lon = buf.get_i32_le();
13797 __struct.arc_entry_lat = buf.get_i32_le();
13798 __struct.arc_entry_lon = buf.get_i32_le();
13799 __struct.altitude = buf.get_f32_le();
13800 __struct.expected_travel_distance = buf.get_f32_le();
13801 __struct.cross_track_error = buf.get_f32_le();
13802 let tmp = buf.get_u8();
13803 __struct.stage =
13804 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13805 enum_type: "DeepstallStage",
13806 value: tmp as u32,
13807 })?;
13808 Ok(__struct)
13809 }
13810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13811 let mut __tmp = BytesMut::new(bytes);
13812 #[allow(clippy::absurd_extreme_comparisons)]
13813 #[allow(unused_comparisons)]
13814 if __tmp.remaining() < Self::ENCODED_LEN {
13815 panic!(
13816 "buffer is too small (need {} bytes, but got {})",
13817 Self::ENCODED_LEN,
13818 __tmp.remaining(),
13819 )
13820 }
13821 __tmp.put_i32_le(self.landing_lat);
13822 __tmp.put_i32_le(self.landing_lon);
13823 __tmp.put_i32_le(self.path_lat);
13824 __tmp.put_i32_le(self.path_lon);
13825 __tmp.put_i32_le(self.arc_entry_lat);
13826 __tmp.put_i32_le(self.arc_entry_lon);
13827 __tmp.put_f32_le(self.altitude);
13828 __tmp.put_f32_le(self.expected_travel_distance);
13829 __tmp.put_f32_le(self.cross_track_error);
13830 __tmp.put_u8(self.stage as u8);
13831 if matches!(version, MavlinkVersion::V2) {
13832 let len = __tmp.len();
13833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13834 } else {
13835 __tmp.len()
13836 }
13837 }
13838}
13839#[doc = "id: 11000"]
13840#[doc = "Read registers for a device."]
13841#[derive(Debug, Clone, PartialEq)]
13842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13844pub struct DEVICE_OP_READ_DATA {
13845 #[doc = "Request ID - copied to reply."]
13846 pub request_id: u32,
13847 #[doc = "System ID."]
13848 pub target_system: u8,
13849 #[doc = "Component ID."]
13850 pub target_component: u8,
13851 #[doc = "The bus type."]
13852 pub bustype: DeviceOpBustype,
13853 #[doc = "Bus number."]
13854 pub bus: u8,
13855 #[doc = "Bus address."]
13856 pub address: u8,
13857 #[doc = "Name of device on bus (for SPI)."]
13858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13859 pub busname: [u8; 40],
13860 #[doc = "First register to read."]
13861 pub regstart: u8,
13862 #[doc = "Count of registers to read."]
13863 pub count: u8,
13864 #[doc = "Bank number."]
13865 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13866 pub bank: u8,
13867}
13868impl DEVICE_OP_READ_DATA {
13869 pub const ENCODED_LEN: usize = 52usize;
13870 pub const DEFAULT: Self = Self {
13871 request_id: 0_u32,
13872 target_system: 0_u8,
13873 target_component: 0_u8,
13874 bustype: DeviceOpBustype::DEFAULT,
13875 bus: 0_u8,
13876 address: 0_u8,
13877 busname: [0_u8; 40usize],
13878 regstart: 0_u8,
13879 count: 0_u8,
13880 bank: 0_u8,
13881 };
13882 #[cfg(feature = "arbitrary")]
13883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13884 use arbitrary::{Arbitrary, Unstructured};
13885 let mut buf = [0u8; 1024];
13886 rng.fill_bytes(&mut buf);
13887 let mut unstructured = Unstructured::new(&buf);
13888 Self::arbitrary(&mut unstructured).unwrap_or_default()
13889 }
13890}
13891impl Default for DEVICE_OP_READ_DATA {
13892 fn default() -> Self {
13893 Self::DEFAULT.clone()
13894 }
13895}
13896impl MessageData for DEVICE_OP_READ_DATA {
13897 type Message = MavMessage;
13898 const ID: u32 = 11000u32;
13899 const NAME: &'static str = "DEVICE_OP_READ";
13900 const EXTRA_CRC: u8 = 134u8;
13901 const ENCODED_LEN: usize = 52usize;
13902 fn deser(
13903 _version: MavlinkVersion,
13904 __input: &[u8],
13905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13906 let avail_len = __input.len();
13907 let mut payload_buf = [0; Self::ENCODED_LEN];
13908 let mut buf = if avail_len < Self::ENCODED_LEN {
13909 payload_buf[0..avail_len].copy_from_slice(__input);
13910 Bytes::new(&payload_buf)
13911 } else {
13912 Bytes::new(__input)
13913 };
13914 let mut __struct = Self::default();
13915 __struct.request_id = buf.get_u32_le();
13916 __struct.target_system = buf.get_u8();
13917 __struct.target_component = buf.get_u8();
13918 let tmp = buf.get_u8();
13919 __struct.bustype =
13920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13921 enum_type: "DeviceOpBustype",
13922 value: tmp as u32,
13923 })?;
13924 __struct.bus = buf.get_u8();
13925 __struct.address = buf.get_u8();
13926 for v in &mut __struct.busname {
13927 let val = buf.get_u8();
13928 *v = val;
13929 }
13930 __struct.regstart = buf.get_u8();
13931 __struct.count = buf.get_u8();
13932 __struct.bank = buf.get_u8();
13933 Ok(__struct)
13934 }
13935 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13936 let mut __tmp = BytesMut::new(bytes);
13937 #[allow(clippy::absurd_extreme_comparisons)]
13938 #[allow(unused_comparisons)]
13939 if __tmp.remaining() < Self::ENCODED_LEN {
13940 panic!(
13941 "buffer is too small (need {} bytes, but got {})",
13942 Self::ENCODED_LEN,
13943 __tmp.remaining(),
13944 )
13945 }
13946 __tmp.put_u32_le(self.request_id);
13947 __tmp.put_u8(self.target_system);
13948 __tmp.put_u8(self.target_component);
13949 __tmp.put_u8(self.bustype as u8);
13950 __tmp.put_u8(self.bus);
13951 __tmp.put_u8(self.address);
13952 for val in &self.busname {
13953 __tmp.put_u8(*val);
13954 }
13955 __tmp.put_u8(self.regstart);
13956 __tmp.put_u8(self.count);
13957 __tmp.put_u8(self.bank);
13958 if matches!(version, MavlinkVersion::V2) {
13959 let len = __tmp.len();
13960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13961 } else {
13962 __tmp.len()
13963 }
13964 }
13965}
13966#[doc = "id: 11001"]
13967#[doc = "Read registers reply."]
13968#[derive(Debug, Clone, PartialEq)]
13969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13971pub struct DEVICE_OP_READ_REPLY_DATA {
13972 #[doc = "Request ID - copied from request."]
13973 pub request_id: u32,
13974 #[doc = "0 for success, anything else is failure code."]
13975 pub result: u8,
13976 #[doc = "Starting register."]
13977 pub regstart: u8,
13978 #[doc = "Count of bytes read."]
13979 pub count: u8,
13980 #[doc = "Reply data."]
13981 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13982 pub data: [u8; 128],
13983 #[doc = "Bank number."]
13984 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13985 pub bank: u8,
13986}
13987impl DEVICE_OP_READ_REPLY_DATA {
13988 pub const ENCODED_LEN: usize = 136usize;
13989 pub const DEFAULT: Self = Self {
13990 request_id: 0_u32,
13991 result: 0_u8,
13992 regstart: 0_u8,
13993 count: 0_u8,
13994 data: [0_u8; 128usize],
13995 bank: 0_u8,
13996 };
13997 #[cfg(feature = "arbitrary")]
13998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13999 use arbitrary::{Arbitrary, Unstructured};
14000 let mut buf = [0u8; 1024];
14001 rng.fill_bytes(&mut buf);
14002 let mut unstructured = Unstructured::new(&buf);
14003 Self::arbitrary(&mut unstructured).unwrap_or_default()
14004 }
14005}
14006impl Default for DEVICE_OP_READ_REPLY_DATA {
14007 fn default() -> Self {
14008 Self::DEFAULT.clone()
14009 }
14010}
14011impl MessageData for DEVICE_OP_READ_REPLY_DATA {
14012 type Message = MavMessage;
14013 const ID: u32 = 11001u32;
14014 const NAME: &'static str = "DEVICE_OP_READ_REPLY";
14015 const EXTRA_CRC: u8 = 15u8;
14016 const ENCODED_LEN: usize = 136usize;
14017 fn deser(
14018 _version: MavlinkVersion,
14019 __input: &[u8],
14020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14021 let avail_len = __input.len();
14022 let mut payload_buf = [0; Self::ENCODED_LEN];
14023 let mut buf = if avail_len < Self::ENCODED_LEN {
14024 payload_buf[0..avail_len].copy_from_slice(__input);
14025 Bytes::new(&payload_buf)
14026 } else {
14027 Bytes::new(__input)
14028 };
14029 let mut __struct = Self::default();
14030 __struct.request_id = buf.get_u32_le();
14031 __struct.result = buf.get_u8();
14032 __struct.regstart = buf.get_u8();
14033 __struct.count = buf.get_u8();
14034 for v in &mut __struct.data {
14035 let val = buf.get_u8();
14036 *v = val;
14037 }
14038 __struct.bank = buf.get_u8();
14039 Ok(__struct)
14040 }
14041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14042 let mut __tmp = BytesMut::new(bytes);
14043 #[allow(clippy::absurd_extreme_comparisons)]
14044 #[allow(unused_comparisons)]
14045 if __tmp.remaining() < Self::ENCODED_LEN {
14046 panic!(
14047 "buffer is too small (need {} bytes, but got {})",
14048 Self::ENCODED_LEN,
14049 __tmp.remaining(),
14050 )
14051 }
14052 __tmp.put_u32_le(self.request_id);
14053 __tmp.put_u8(self.result);
14054 __tmp.put_u8(self.regstart);
14055 __tmp.put_u8(self.count);
14056 for val in &self.data {
14057 __tmp.put_u8(*val);
14058 }
14059 __tmp.put_u8(self.bank);
14060 if matches!(version, MavlinkVersion::V2) {
14061 let len = __tmp.len();
14062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14063 } else {
14064 __tmp.len()
14065 }
14066 }
14067}
14068#[doc = "id: 11002"]
14069#[doc = "Write registers for a device."]
14070#[derive(Debug, Clone, PartialEq)]
14071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14073pub struct DEVICE_OP_WRITE_DATA {
14074 #[doc = "Request ID - copied to reply."]
14075 pub request_id: u32,
14076 #[doc = "System ID."]
14077 pub target_system: u8,
14078 #[doc = "Component ID."]
14079 pub target_component: u8,
14080 #[doc = "The bus type."]
14081 pub bustype: DeviceOpBustype,
14082 #[doc = "Bus number."]
14083 pub bus: u8,
14084 #[doc = "Bus address."]
14085 pub address: u8,
14086 #[doc = "Name of device on bus (for SPI)."]
14087 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14088 pub busname: [u8; 40],
14089 #[doc = "First register to write."]
14090 pub regstart: u8,
14091 #[doc = "Count of registers to write."]
14092 pub count: u8,
14093 #[doc = "Write data."]
14094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14095 pub data: [u8; 128],
14096 #[doc = "Bank number."]
14097 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14098 pub bank: u8,
14099}
14100impl DEVICE_OP_WRITE_DATA {
14101 pub const ENCODED_LEN: usize = 180usize;
14102 pub const DEFAULT: Self = Self {
14103 request_id: 0_u32,
14104 target_system: 0_u8,
14105 target_component: 0_u8,
14106 bustype: DeviceOpBustype::DEFAULT,
14107 bus: 0_u8,
14108 address: 0_u8,
14109 busname: [0_u8; 40usize],
14110 regstart: 0_u8,
14111 count: 0_u8,
14112 data: [0_u8; 128usize],
14113 bank: 0_u8,
14114 };
14115 #[cfg(feature = "arbitrary")]
14116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14117 use arbitrary::{Arbitrary, Unstructured};
14118 let mut buf = [0u8; 1024];
14119 rng.fill_bytes(&mut buf);
14120 let mut unstructured = Unstructured::new(&buf);
14121 Self::arbitrary(&mut unstructured).unwrap_or_default()
14122 }
14123}
14124impl Default for DEVICE_OP_WRITE_DATA {
14125 fn default() -> Self {
14126 Self::DEFAULT.clone()
14127 }
14128}
14129impl MessageData for DEVICE_OP_WRITE_DATA {
14130 type Message = MavMessage;
14131 const ID: u32 = 11002u32;
14132 const NAME: &'static str = "DEVICE_OP_WRITE";
14133 const EXTRA_CRC: u8 = 234u8;
14134 const ENCODED_LEN: usize = 180usize;
14135 fn deser(
14136 _version: MavlinkVersion,
14137 __input: &[u8],
14138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14139 let avail_len = __input.len();
14140 let mut payload_buf = [0; Self::ENCODED_LEN];
14141 let mut buf = if avail_len < Self::ENCODED_LEN {
14142 payload_buf[0..avail_len].copy_from_slice(__input);
14143 Bytes::new(&payload_buf)
14144 } else {
14145 Bytes::new(__input)
14146 };
14147 let mut __struct = Self::default();
14148 __struct.request_id = buf.get_u32_le();
14149 __struct.target_system = buf.get_u8();
14150 __struct.target_component = buf.get_u8();
14151 let tmp = buf.get_u8();
14152 __struct.bustype =
14153 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14154 enum_type: "DeviceOpBustype",
14155 value: tmp as u32,
14156 })?;
14157 __struct.bus = buf.get_u8();
14158 __struct.address = buf.get_u8();
14159 for v in &mut __struct.busname {
14160 let val = buf.get_u8();
14161 *v = val;
14162 }
14163 __struct.regstart = buf.get_u8();
14164 __struct.count = buf.get_u8();
14165 for v in &mut __struct.data {
14166 let val = buf.get_u8();
14167 *v = val;
14168 }
14169 __struct.bank = buf.get_u8();
14170 Ok(__struct)
14171 }
14172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14173 let mut __tmp = BytesMut::new(bytes);
14174 #[allow(clippy::absurd_extreme_comparisons)]
14175 #[allow(unused_comparisons)]
14176 if __tmp.remaining() < Self::ENCODED_LEN {
14177 panic!(
14178 "buffer is too small (need {} bytes, but got {})",
14179 Self::ENCODED_LEN,
14180 __tmp.remaining(),
14181 )
14182 }
14183 __tmp.put_u32_le(self.request_id);
14184 __tmp.put_u8(self.target_system);
14185 __tmp.put_u8(self.target_component);
14186 __tmp.put_u8(self.bustype as u8);
14187 __tmp.put_u8(self.bus);
14188 __tmp.put_u8(self.address);
14189 for val in &self.busname {
14190 __tmp.put_u8(*val);
14191 }
14192 __tmp.put_u8(self.regstart);
14193 __tmp.put_u8(self.count);
14194 for val in &self.data {
14195 __tmp.put_u8(*val);
14196 }
14197 __tmp.put_u8(self.bank);
14198 if matches!(version, MavlinkVersion::V2) {
14199 let len = __tmp.len();
14200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14201 } else {
14202 __tmp.len()
14203 }
14204 }
14205}
14206#[doc = "id: 11003"]
14207#[doc = "Write registers reply."]
14208#[derive(Debug, Clone, PartialEq)]
14209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14211pub struct DEVICE_OP_WRITE_REPLY_DATA {
14212 #[doc = "Request ID - copied from request."]
14213 pub request_id: u32,
14214 #[doc = "0 for success, anything else is failure code."]
14215 pub result: u8,
14216}
14217impl DEVICE_OP_WRITE_REPLY_DATA {
14218 pub const ENCODED_LEN: usize = 5usize;
14219 pub const DEFAULT: Self = Self {
14220 request_id: 0_u32,
14221 result: 0_u8,
14222 };
14223 #[cfg(feature = "arbitrary")]
14224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14225 use arbitrary::{Arbitrary, Unstructured};
14226 let mut buf = [0u8; 1024];
14227 rng.fill_bytes(&mut buf);
14228 let mut unstructured = Unstructured::new(&buf);
14229 Self::arbitrary(&mut unstructured).unwrap_or_default()
14230 }
14231}
14232impl Default for DEVICE_OP_WRITE_REPLY_DATA {
14233 fn default() -> Self {
14234 Self::DEFAULT.clone()
14235 }
14236}
14237impl MessageData for DEVICE_OP_WRITE_REPLY_DATA {
14238 type Message = MavMessage;
14239 const ID: u32 = 11003u32;
14240 const NAME: &'static str = "DEVICE_OP_WRITE_REPLY";
14241 const EXTRA_CRC: u8 = 64u8;
14242 const ENCODED_LEN: usize = 5usize;
14243 fn deser(
14244 _version: MavlinkVersion,
14245 __input: &[u8],
14246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14247 let avail_len = __input.len();
14248 let mut payload_buf = [0; Self::ENCODED_LEN];
14249 let mut buf = if avail_len < Self::ENCODED_LEN {
14250 payload_buf[0..avail_len].copy_from_slice(__input);
14251 Bytes::new(&payload_buf)
14252 } else {
14253 Bytes::new(__input)
14254 };
14255 let mut __struct = Self::default();
14256 __struct.request_id = buf.get_u32_le();
14257 __struct.result = buf.get_u8();
14258 Ok(__struct)
14259 }
14260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14261 let mut __tmp = BytesMut::new(bytes);
14262 #[allow(clippy::absurd_extreme_comparisons)]
14263 #[allow(unused_comparisons)]
14264 if __tmp.remaining() < Self::ENCODED_LEN {
14265 panic!(
14266 "buffer is too small (need {} bytes, but got {})",
14267 Self::ENCODED_LEN,
14268 __tmp.remaining(),
14269 )
14270 }
14271 __tmp.put_u32_le(self.request_id);
14272 __tmp.put_u8(self.result);
14273 if matches!(version, MavlinkVersion::V2) {
14274 let len = __tmp.len();
14275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14276 } else {
14277 __tmp.len()
14278 }
14279 }
14280}
14281#[doc = "id: 154"]
14282#[doc = "Configure on-board Camera Control System."]
14283#[derive(Debug, Clone, PartialEq)]
14284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14286pub struct DIGICAM_CONFIGURE_DATA {
14287 #[doc = "Correspondent value to given extra_param."]
14288 pub extra_value: f32,
14289 #[doc = "Divisor number //e.g. 1000 means 1/1000 (0 means ignore)."]
14290 pub shutter_speed: u16,
14291 #[doc = "System ID."]
14292 pub target_system: u8,
14293 #[doc = "Component ID."]
14294 pub target_component: u8,
14295 #[doc = "Mode enumeration from 1 to N //P, TV, AV, M, etc. (0 means ignore)."]
14296 pub mode: u8,
14297 #[doc = "F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)."]
14298 pub aperture: u8,
14299 #[doc = "ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)."]
14300 pub iso: u8,
14301 #[doc = "Exposure type enumeration from 1 to N (0 means ignore)."]
14302 pub exposure_type: u8,
14303 #[doc = "Command Identity (incremental loop: 0 to 255). //A command sent multiple times will be executed or pooled just once."]
14304 pub command_id: u8,
14305 #[doc = "Main engine cut-off time before camera trigger (0 means no cut-off)."]
14306 pub engine_cut_off: u8,
14307 #[doc = "Extra parameters enumeration (0 means ignore)."]
14308 pub extra_param: u8,
14309}
14310impl DIGICAM_CONFIGURE_DATA {
14311 pub const ENCODED_LEN: usize = 15usize;
14312 pub const DEFAULT: Self = Self {
14313 extra_value: 0.0_f32,
14314 shutter_speed: 0_u16,
14315 target_system: 0_u8,
14316 target_component: 0_u8,
14317 mode: 0_u8,
14318 aperture: 0_u8,
14319 iso: 0_u8,
14320 exposure_type: 0_u8,
14321 command_id: 0_u8,
14322 engine_cut_off: 0_u8,
14323 extra_param: 0_u8,
14324 };
14325 #[cfg(feature = "arbitrary")]
14326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14327 use arbitrary::{Arbitrary, Unstructured};
14328 let mut buf = [0u8; 1024];
14329 rng.fill_bytes(&mut buf);
14330 let mut unstructured = Unstructured::new(&buf);
14331 Self::arbitrary(&mut unstructured).unwrap_or_default()
14332 }
14333}
14334impl Default for DIGICAM_CONFIGURE_DATA {
14335 fn default() -> Self {
14336 Self::DEFAULT.clone()
14337 }
14338}
14339impl MessageData for DIGICAM_CONFIGURE_DATA {
14340 type Message = MavMessage;
14341 const ID: u32 = 154u32;
14342 const NAME: &'static str = "DIGICAM_CONFIGURE";
14343 const EXTRA_CRC: u8 = 84u8;
14344 const ENCODED_LEN: usize = 15usize;
14345 fn deser(
14346 _version: MavlinkVersion,
14347 __input: &[u8],
14348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14349 let avail_len = __input.len();
14350 let mut payload_buf = [0; Self::ENCODED_LEN];
14351 let mut buf = if avail_len < Self::ENCODED_LEN {
14352 payload_buf[0..avail_len].copy_from_slice(__input);
14353 Bytes::new(&payload_buf)
14354 } else {
14355 Bytes::new(__input)
14356 };
14357 let mut __struct = Self::default();
14358 __struct.extra_value = buf.get_f32_le();
14359 __struct.shutter_speed = buf.get_u16_le();
14360 __struct.target_system = buf.get_u8();
14361 __struct.target_component = buf.get_u8();
14362 __struct.mode = buf.get_u8();
14363 __struct.aperture = buf.get_u8();
14364 __struct.iso = buf.get_u8();
14365 __struct.exposure_type = buf.get_u8();
14366 __struct.command_id = buf.get_u8();
14367 __struct.engine_cut_off = buf.get_u8();
14368 __struct.extra_param = buf.get_u8();
14369 Ok(__struct)
14370 }
14371 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14372 let mut __tmp = BytesMut::new(bytes);
14373 #[allow(clippy::absurd_extreme_comparisons)]
14374 #[allow(unused_comparisons)]
14375 if __tmp.remaining() < Self::ENCODED_LEN {
14376 panic!(
14377 "buffer is too small (need {} bytes, but got {})",
14378 Self::ENCODED_LEN,
14379 __tmp.remaining(),
14380 )
14381 }
14382 __tmp.put_f32_le(self.extra_value);
14383 __tmp.put_u16_le(self.shutter_speed);
14384 __tmp.put_u8(self.target_system);
14385 __tmp.put_u8(self.target_component);
14386 __tmp.put_u8(self.mode);
14387 __tmp.put_u8(self.aperture);
14388 __tmp.put_u8(self.iso);
14389 __tmp.put_u8(self.exposure_type);
14390 __tmp.put_u8(self.command_id);
14391 __tmp.put_u8(self.engine_cut_off);
14392 __tmp.put_u8(self.extra_param);
14393 if matches!(version, MavlinkVersion::V2) {
14394 let len = __tmp.len();
14395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14396 } else {
14397 __tmp.len()
14398 }
14399 }
14400}
14401#[doc = "id: 155"]
14402#[doc = "Control on-board Camera Control System to take shots."]
14403#[derive(Debug, Clone, PartialEq)]
14404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14406pub struct DIGICAM_CONTROL_DATA {
14407 #[doc = "Correspondent value to given extra_param."]
14408 pub extra_value: f32,
14409 #[doc = "System ID."]
14410 pub target_system: u8,
14411 #[doc = "Component ID."]
14412 pub target_component: u8,
14413 #[doc = "0: stop, 1: start or keep it up //Session control e.g. show/hide lens."]
14414 pub session: u8,
14415 #[doc = "1 to N //Zoom's absolute position (0 means ignore)."]
14416 pub zoom_pos: u8,
14417 #[doc = "-100 to 100 //Zooming step value to offset zoom from the current position."]
14418 pub zoom_step: i8,
14419 #[doc = "0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus."]
14420 pub focus_lock: u8,
14421 #[doc = "0: ignore, 1: shot or start filming."]
14422 pub shot: u8,
14423 #[doc = "Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once."]
14424 pub command_id: u8,
14425 #[doc = "Extra parameters enumeration (0 means ignore)."]
14426 pub extra_param: u8,
14427}
14428impl DIGICAM_CONTROL_DATA {
14429 pub const ENCODED_LEN: usize = 13usize;
14430 pub const DEFAULT: Self = Self {
14431 extra_value: 0.0_f32,
14432 target_system: 0_u8,
14433 target_component: 0_u8,
14434 session: 0_u8,
14435 zoom_pos: 0_u8,
14436 zoom_step: 0_i8,
14437 focus_lock: 0_u8,
14438 shot: 0_u8,
14439 command_id: 0_u8,
14440 extra_param: 0_u8,
14441 };
14442 #[cfg(feature = "arbitrary")]
14443 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14444 use arbitrary::{Arbitrary, Unstructured};
14445 let mut buf = [0u8; 1024];
14446 rng.fill_bytes(&mut buf);
14447 let mut unstructured = Unstructured::new(&buf);
14448 Self::arbitrary(&mut unstructured).unwrap_or_default()
14449 }
14450}
14451impl Default for DIGICAM_CONTROL_DATA {
14452 fn default() -> Self {
14453 Self::DEFAULT.clone()
14454 }
14455}
14456impl MessageData for DIGICAM_CONTROL_DATA {
14457 type Message = MavMessage;
14458 const ID: u32 = 155u32;
14459 const NAME: &'static str = "DIGICAM_CONTROL";
14460 const EXTRA_CRC: u8 = 22u8;
14461 const ENCODED_LEN: usize = 13usize;
14462 fn deser(
14463 _version: MavlinkVersion,
14464 __input: &[u8],
14465 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14466 let avail_len = __input.len();
14467 let mut payload_buf = [0; Self::ENCODED_LEN];
14468 let mut buf = if avail_len < Self::ENCODED_LEN {
14469 payload_buf[0..avail_len].copy_from_slice(__input);
14470 Bytes::new(&payload_buf)
14471 } else {
14472 Bytes::new(__input)
14473 };
14474 let mut __struct = Self::default();
14475 __struct.extra_value = buf.get_f32_le();
14476 __struct.target_system = buf.get_u8();
14477 __struct.target_component = buf.get_u8();
14478 __struct.session = buf.get_u8();
14479 __struct.zoom_pos = buf.get_u8();
14480 __struct.zoom_step = buf.get_i8();
14481 __struct.focus_lock = buf.get_u8();
14482 __struct.shot = buf.get_u8();
14483 __struct.command_id = buf.get_u8();
14484 __struct.extra_param = buf.get_u8();
14485 Ok(__struct)
14486 }
14487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14488 let mut __tmp = BytesMut::new(bytes);
14489 #[allow(clippy::absurd_extreme_comparisons)]
14490 #[allow(unused_comparisons)]
14491 if __tmp.remaining() < Self::ENCODED_LEN {
14492 panic!(
14493 "buffer is too small (need {} bytes, but got {})",
14494 Self::ENCODED_LEN,
14495 __tmp.remaining(),
14496 )
14497 }
14498 __tmp.put_f32_le(self.extra_value);
14499 __tmp.put_u8(self.target_system);
14500 __tmp.put_u8(self.target_component);
14501 __tmp.put_u8(self.session);
14502 __tmp.put_u8(self.zoom_pos);
14503 __tmp.put_i8(self.zoom_step);
14504 __tmp.put_u8(self.focus_lock);
14505 __tmp.put_u8(self.shot);
14506 __tmp.put_u8(self.command_id);
14507 __tmp.put_u8(self.extra_param);
14508 if matches!(version, MavlinkVersion::V2) {
14509 let len = __tmp.len();
14510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14511 } else {
14512 __tmp.len()
14513 }
14514 }
14515}
14516#[doc = "id: 132"]
14517#[doc = "Distance sensor information for an onboard rangefinder."]
14518#[derive(Debug, Clone, PartialEq)]
14519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14521pub struct DISTANCE_SENSOR_DATA {
14522 #[doc = "Timestamp (time since system boot)."]
14523 pub time_boot_ms: u32,
14524 #[doc = "Minimum distance the sensor can measure"]
14525 pub min_distance: u16,
14526 #[doc = "Maximum distance the sensor can measure"]
14527 pub max_distance: u16,
14528 #[doc = "Current distance reading"]
14529 pub current_distance: u16,
14530 #[doc = "Type of distance sensor."]
14531 pub mavtype: MavDistanceSensor,
14532 #[doc = "Onboard ID of the sensor"]
14533 pub id: u8,
14534 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
14535 pub orientation: MavSensorOrientation,
14536 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
14537 pub covariance: u8,
14538 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
14539 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14540 pub horizontal_fov: f32,
14541 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
14542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14543 pub vertical_fov: f32,
14544 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
14545 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14546 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14547 pub quaternion: [f32; 4],
14548 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
14549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14550 pub signal_quality: u8,
14551}
14552impl DISTANCE_SENSOR_DATA {
14553 pub const ENCODED_LEN: usize = 39usize;
14554 pub const DEFAULT: Self = Self {
14555 time_boot_ms: 0_u32,
14556 min_distance: 0_u16,
14557 max_distance: 0_u16,
14558 current_distance: 0_u16,
14559 mavtype: MavDistanceSensor::DEFAULT,
14560 id: 0_u8,
14561 orientation: MavSensorOrientation::DEFAULT,
14562 covariance: 0_u8,
14563 horizontal_fov: 0.0_f32,
14564 vertical_fov: 0.0_f32,
14565 quaternion: [0.0_f32; 4usize],
14566 signal_quality: 0_u8,
14567 };
14568 #[cfg(feature = "arbitrary")]
14569 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14570 use arbitrary::{Arbitrary, Unstructured};
14571 let mut buf = [0u8; 1024];
14572 rng.fill_bytes(&mut buf);
14573 let mut unstructured = Unstructured::new(&buf);
14574 Self::arbitrary(&mut unstructured).unwrap_or_default()
14575 }
14576}
14577impl Default for DISTANCE_SENSOR_DATA {
14578 fn default() -> Self {
14579 Self::DEFAULT.clone()
14580 }
14581}
14582impl MessageData for DISTANCE_SENSOR_DATA {
14583 type Message = MavMessage;
14584 const ID: u32 = 132u32;
14585 const NAME: &'static str = "DISTANCE_SENSOR";
14586 const EXTRA_CRC: u8 = 85u8;
14587 const ENCODED_LEN: usize = 39usize;
14588 fn deser(
14589 _version: MavlinkVersion,
14590 __input: &[u8],
14591 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14592 let avail_len = __input.len();
14593 let mut payload_buf = [0; Self::ENCODED_LEN];
14594 let mut buf = if avail_len < Self::ENCODED_LEN {
14595 payload_buf[0..avail_len].copy_from_slice(__input);
14596 Bytes::new(&payload_buf)
14597 } else {
14598 Bytes::new(__input)
14599 };
14600 let mut __struct = Self::default();
14601 __struct.time_boot_ms = buf.get_u32_le();
14602 __struct.min_distance = buf.get_u16_le();
14603 __struct.max_distance = buf.get_u16_le();
14604 __struct.current_distance = buf.get_u16_le();
14605 let tmp = buf.get_u8();
14606 __struct.mavtype =
14607 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14608 enum_type: "MavDistanceSensor",
14609 value: tmp as u32,
14610 })?;
14611 __struct.id = buf.get_u8();
14612 let tmp = buf.get_u8();
14613 __struct.orientation =
14614 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14615 enum_type: "MavSensorOrientation",
14616 value: tmp as u32,
14617 })?;
14618 __struct.covariance = buf.get_u8();
14619 __struct.horizontal_fov = buf.get_f32_le();
14620 __struct.vertical_fov = buf.get_f32_le();
14621 for v in &mut __struct.quaternion {
14622 let val = buf.get_f32_le();
14623 *v = val;
14624 }
14625 __struct.signal_quality = buf.get_u8();
14626 Ok(__struct)
14627 }
14628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14629 let mut __tmp = BytesMut::new(bytes);
14630 #[allow(clippy::absurd_extreme_comparisons)]
14631 #[allow(unused_comparisons)]
14632 if __tmp.remaining() < Self::ENCODED_LEN {
14633 panic!(
14634 "buffer is too small (need {} bytes, but got {})",
14635 Self::ENCODED_LEN,
14636 __tmp.remaining(),
14637 )
14638 }
14639 __tmp.put_u32_le(self.time_boot_ms);
14640 __tmp.put_u16_le(self.min_distance);
14641 __tmp.put_u16_le(self.max_distance);
14642 __tmp.put_u16_le(self.current_distance);
14643 __tmp.put_u8(self.mavtype as u8);
14644 __tmp.put_u8(self.id);
14645 __tmp.put_u8(self.orientation as u8);
14646 __tmp.put_u8(self.covariance);
14647 __tmp.put_f32_le(self.horizontal_fov);
14648 __tmp.put_f32_le(self.vertical_fov);
14649 for val in &self.quaternion {
14650 __tmp.put_f32_le(*val);
14651 }
14652 __tmp.put_u8(self.signal_quality);
14653 if matches!(version, MavlinkVersion::V2) {
14654 let len = __tmp.len();
14655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14656 } else {
14657 __tmp.len()
14658 }
14659 }
14660}
14661#[doc = "id: 225"]
14662#[doc = "EFI status output."]
14663#[derive(Debug, Clone, PartialEq)]
14664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14666pub struct EFI_STATUS_DATA {
14667 #[doc = "ECU index"]
14668 pub ecu_index: f32,
14669 #[doc = "RPM"]
14670 pub rpm: f32,
14671 #[doc = "Fuel consumed"]
14672 pub fuel_consumed: f32,
14673 #[doc = "Fuel flow rate"]
14674 pub fuel_flow: f32,
14675 #[doc = "Engine load"]
14676 pub engine_load: f32,
14677 #[doc = "Throttle position"]
14678 pub throttle_position: f32,
14679 #[doc = "Spark dwell time"]
14680 pub spark_dwell_time: f32,
14681 #[doc = "Barometric pressure"]
14682 pub barometric_pressure: f32,
14683 #[doc = "Intake manifold pressure("]
14684 pub intake_manifold_pressure: f32,
14685 #[doc = "Intake manifold temperature"]
14686 pub intake_manifold_temperature: f32,
14687 #[doc = "Cylinder head temperature"]
14688 pub cylinder_head_temperature: f32,
14689 #[doc = "Ignition timing (Crank angle degrees)"]
14690 pub ignition_timing: f32,
14691 #[doc = "Injection time"]
14692 pub injection_time: f32,
14693 #[doc = "Exhaust gas temperature"]
14694 pub exhaust_gas_temperature: f32,
14695 #[doc = "Output throttle"]
14696 pub throttle_out: f32,
14697 #[doc = "Pressure/temperature compensation"]
14698 pub pt_compensation: f32,
14699 #[doc = "EFI health status"]
14700 pub health: u8,
14701 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
14702 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14703 pub ignition_voltage: f32,
14704 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
14705 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14706 pub fuel_pressure: f32,
14707}
14708impl EFI_STATUS_DATA {
14709 pub const ENCODED_LEN: usize = 73usize;
14710 pub const DEFAULT: Self = Self {
14711 ecu_index: 0.0_f32,
14712 rpm: 0.0_f32,
14713 fuel_consumed: 0.0_f32,
14714 fuel_flow: 0.0_f32,
14715 engine_load: 0.0_f32,
14716 throttle_position: 0.0_f32,
14717 spark_dwell_time: 0.0_f32,
14718 barometric_pressure: 0.0_f32,
14719 intake_manifold_pressure: 0.0_f32,
14720 intake_manifold_temperature: 0.0_f32,
14721 cylinder_head_temperature: 0.0_f32,
14722 ignition_timing: 0.0_f32,
14723 injection_time: 0.0_f32,
14724 exhaust_gas_temperature: 0.0_f32,
14725 throttle_out: 0.0_f32,
14726 pt_compensation: 0.0_f32,
14727 health: 0_u8,
14728 ignition_voltage: 0.0_f32,
14729 fuel_pressure: 0.0_f32,
14730 };
14731 #[cfg(feature = "arbitrary")]
14732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14733 use arbitrary::{Arbitrary, Unstructured};
14734 let mut buf = [0u8; 1024];
14735 rng.fill_bytes(&mut buf);
14736 let mut unstructured = Unstructured::new(&buf);
14737 Self::arbitrary(&mut unstructured).unwrap_or_default()
14738 }
14739}
14740impl Default for EFI_STATUS_DATA {
14741 fn default() -> Self {
14742 Self::DEFAULT.clone()
14743 }
14744}
14745impl MessageData for EFI_STATUS_DATA {
14746 type Message = MavMessage;
14747 const ID: u32 = 225u32;
14748 const NAME: &'static str = "EFI_STATUS";
14749 const EXTRA_CRC: u8 = 208u8;
14750 const ENCODED_LEN: usize = 73usize;
14751 fn deser(
14752 _version: MavlinkVersion,
14753 __input: &[u8],
14754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14755 let avail_len = __input.len();
14756 let mut payload_buf = [0; Self::ENCODED_LEN];
14757 let mut buf = if avail_len < Self::ENCODED_LEN {
14758 payload_buf[0..avail_len].copy_from_slice(__input);
14759 Bytes::new(&payload_buf)
14760 } else {
14761 Bytes::new(__input)
14762 };
14763 let mut __struct = Self::default();
14764 __struct.ecu_index = buf.get_f32_le();
14765 __struct.rpm = buf.get_f32_le();
14766 __struct.fuel_consumed = buf.get_f32_le();
14767 __struct.fuel_flow = buf.get_f32_le();
14768 __struct.engine_load = buf.get_f32_le();
14769 __struct.throttle_position = buf.get_f32_le();
14770 __struct.spark_dwell_time = buf.get_f32_le();
14771 __struct.barometric_pressure = buf.get_f32_le();
14772 __struct.intake_manifold_pressure = buf.get_f32_le();
14773 __struct.intake_manifold_temperature = buf.get_f32_le();
14774 __struct.cylinder_head_temperature = buf.get_f32_le();
14775 __struct.ignition_timing = buf.get_f32_le();
14776 __struct.injection_time = buf.get_f32_le();
14777 __struct.exhaust_gas_temperature = buf.get_f32_le();
14778 __struct.throttle_out = buf.get_f32_le();
14779 __struct.pt_compensation = buf.get_f32_le();
14780 __struct.health = buf.get_u8();
14781 __struct.ignition_voltage = buf.get_f32_le();
14782 __struct.fuel_pressure = buf.get_f32_le();
14783 Ok(__struct)
14784 }
14785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14786 let mut __tmp = BytesMut::new(bytes);
14787 #[allow(clippy::absurd_extreme_comparisons)]
14788 #[allow(unused_comparisons)]
14789 if __tmp.remaining() < Self::ENCODED_LEN {
14790 panic!(
14791 "buffer is too small (need {} bytes, but got {})",
14792 Self::ENCODED_LEN,
14793 __tmp.remaining(),
14794 )
14795 }
14796 __tmp.put_f32_le(self.ecu_index);
14797 __tmp.put_f32_le(self.rpm);
14798 __tmp.put_f32_le(self.fuel_consumed);
14799 __tmp.put_f32_le(self.fuel_flow);
14800 __tmp.put_f32_le(self.engine_load);
14801 __tmp.put_f32_le(self.throttle_position);
14802 __tmp.put_f32_le(self.spark_dwell_time);
14803 __tmp.put_f32_le(self.barometric_pressure);
14804 __tmp.put_f32_le(self.intake_manifold_pressure);
14805 __tmp.put_f32_le(self.intake_manifold_temperature);
14806 __tmp.put_f32_le(self.cylinder_head_temperature);
14807 __tmp.put_f32_le(self.ignition_timing);
14808 __tmp.put_f32_le(self.injection_time);
14809 __tmp.put_f32_le(self.exhaust_gas_temperature);
14810 __tmp.put_f32_le(self.throttle_out);
14811 __tmp.put_f32_le(self.pt_compensation);
14812 __tmp.put_u8(self.health);
14813 __tmp.put_f32_le(self.ignition_voltage);
14814 __tmp.put_f32_le(self.fuel_pressure);
14815 if matches!(version, MavlinkVersion::V2) {
14816 let len = __tmp.len();
14817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14818 } else {
14819 __tmp.len()
14820 }
14821 }
14822}
14823#[doc = "id: 193"]
14824#[doc = "EKF Status message including flags and variances."]
14825#[derive(Debug, Clone, PartialEq)]
14826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14828pub struct EKF_STATUS_REPORT_DATA {
14829 #[doc = "Velocity variance."]
14830 pub velocity_variance: f32,
14831 #[doc = "Horizontal Position variance."]
14832 pub pos_horiz_variance: f32,
14833 #[doc = "Vertical Position variance."]
14834 pub pos_vert_variance: f32,
14835 #[doc = "Compass variance."]
14836 pub compass_variance: f32,
14837 #[doc = "Terrain Altitude variance."]
14838 pub terrain_alt_variance: f32,
14839 #[doc = "Flags."]
14840 pub flags: EkfStatusFlags,
14841 #[doc = "Airspeed variance."]
14842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14843 pub airspeed_variance: f32,
14844}
14845impl EKF_STATUS_REPORT_DATA {
14846 pub const ENCODED_LEN: usize = 26usize;
14847 pub const DEFAULT: Self = Self {
14848 velocity_variance: 0.0_f32,
14849 pos_horiz_variance: 0.0_f32,
14850 pos_vert_variance: 0.0_f32,
14851 compass_variance: 0.0_f32,
14852 terrain_alt_variance: 0.0_f32,
14853 flags: EkfStatusFlags::DEFAULT,
14854 airspeed_variance: 0.0_f32,
14855 };
14856 #[cfg(feature = "arbitrary")]
14857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14858 use arbitrary::{Arbitrary, Unstructured};
14859 let mut buf = [0u8; 1024];
14860 rng.fill_bytes(&mut buf);
14861 let mut unstructured = Unstructured::new(&buf);
14862 Self::arbitrary(&mut unstructured).unwrap_or_default()
14863 }
14864}
14865impl Default for EKF_STATUS_REPORT_DATA {
14866 fn default() -> Self {
14867 Self::DEFAULT.clone()
14868 }
14869}
14870impl MessageData for EKF_STATUS_REPORT_DATA {
14871 type Message = MavMessage;
14872 const ID: u32 = 193u32;
14873 const NAME: &'static str = "EKF_STATUS_REPORT";
14874 const EXTRA_CRC: u8 = 71u8;
14875 const ENCODED_LEN: usize = 26usize;
14876 fn deser(
14877 _version: MavlinkVersion,
14878 __input: &[u8],
14879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14880 let avail_len = __input.len();
14881 let mut payload_buf = [0; Self::ENCODED_LEN];
14882 let mut buf = if avail_len < Self::ENCODED_LEN {
14883 payload_buf[0..avail_len].copy_from_slice(__input);
14884 Bytes::new(&payload_buf)
14885 } else {
14886 Bytes::new(__input)
14887 };
14888 let mut __struct = Self::default();
14889 __struct.velocity_variance = buf.get_f32_le();
14890 __struct.pos_horiz_variance = buf.get_f32_le();
14891 __struct.pos_vert_variance = buf.get_f32_le();
14892 __struct.compass_variance = buf.get_f32_le();
14893 __struct.terrain_alt_variance = buf.get_f32_le();
14894 let tmp = buf.get_u16_le();
14895 __struct.flags = EkfStatusFlags::from_bits(tmp & EkfStatusFlags::all().bits()).ok_or(
14896 ::mavlink_core::error::ParserError::InvalidFlag {
14897 flag_type: "EkfStatusFlags",
14898 value: tmp as u32,
14899 },
14900 )?;
14901 __struct.airspeed_variance = buf.get_f32_le();
14902 Ok(__struct)
14903 }
14904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14905 let mut __tmp = BytesMut::new(bytes);
14906 #[allow(clippy::absurd_extreme_comparisons)]
14907 #[allow(unused_comparisons)]
14908 if __tmp.remaining() < Self::ENCODED_LEN {
14909 panic!(
14910 "buffer is too small (need {} bytes, but got {})",
14911 Self::ENCODED_LEN,
14912 __tmp.remaining(),
14913 )
14914 }
14915 __tmp.put_f32_le(self.velocity_variance);
14916 __tmp.put_f32_le(self.pos_horiz_variance);
14917 __tmp.put_f32_le(self.pos_vert_variance);
14918 __tmp.put_f32_le(self.compass_variance);
14919 __tmp.put_f32_le(self.terrain_alt_variance);
14920 __tmp.put_u16_le(self.flags.bits());
14921 __tmp.put_f32_le(self.airspeed_variance);
14922 if matches!(version, MavlinkVersion::V2) {
14923 let len = __tmp.len();
14924 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14925 } else {
14926 __tmp.len()
14927 }
14928 }
14929}
14930#[doc = "id: 131"]
14931#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
14932#[derive(Debug, Clone, PartialEq)]
14933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14935pub struct ENCAPSULATED_DATA_DATA {
14936 #[doc = "sequence number (starting with 0 on every transmission)"]
14937 pub seqnr: u16,
14938 #[doc = "image data bytes"]
14939 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14940 pub data: [u8; 253],
14941}
14942impl ENCAPSULATED_DATA_DATA {
14943 pub const ENCODED_LEN: usize = 255usize;
14944 pub const DEFAULT: Self = Self {
14945 seqnr: 0_u16,
14946 data: [0_u8; 253usize],
14947 };
14948 #[cfg(feature = "arbitrary")]
14949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14950 use arbitrary::{Arbitrary, Unstructured};
14951 let mut buf = [0u8; 1024];
14952 rng.fill_bytes(&mut buf);
14953 let mut unstructured = Unstructured::new(&buf);
14954 Self::arbitrary(&mut unstructured).unwrap_or_default()
14955 }
14956}
14957impl Default for ENCAPSULATED_DATA_DATA {
14958 fn default() -> Self {
14959 Self::DEFAULT.clone()
14960 }
14961}
14962impl MessageData for ENCAPSULATED_DATA_DATA {
14963 type Message = MavMessage;
14964 const ID: u32 = 131u32;
14965 const NAME: &'static str = "ENCAPSULATED_DATA";
14966 const EXTRA_CRC: u8 = 223u8;
14967 const ENCODED_LEN: usize = 255usize;
14968 fn deser(
14969 _version: MavlinkVersion,
14970 __input: &[u8],
14971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14972 let avail_len = __input.len();
14973 let mut payload_buf = [0; Self::ENCODED_LEN];
14974 let mut buf = if avail_len < Self::ENCODED_LEN {
14975 payload_buf[0..avail_len].copy_from_slice(__input);
14976 Bytes::new(&payload_buf)
14977 } else {
14978 Bytes::new(__input)
14979 };
14980 let mut __struct = Self::default();
14981 __struct.seqnr = buf.get_u16_le();
14982 for v in &mut __struct.data {
14983 let val = buf.get_u8();
14984 *v = val;
14985 }
14986 Ok(__struct)
14987 }
14988 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14989 let mut __tmp = BytesMut::new(bytes);
14990 #[allow(clippy::absurd_extreme_comparisons)]
14991 #[allow(unused_comparisons)]
14992 if __tmp.remaining() < Self::ENCODED_LEN {
14993 panic!(
14994 "buffer is too small (need {} bytes, but got {})",
14995 Self::ENCODED_LEN,
14996 __tmp.remaining(),
14997 )
14998 }
14999 __tmp.put_u16_le(self.seqnr);
15000 for val in &self.data {
15001 __tmp.put_u8(*val);
15002 }
15003 if matches!(version, MavlinkVersion::V2) {
15004 let len = __tmp.len();
15005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15006 } else {
15007 __tmp.len()
15008 }
15009 }
15010}
15011#[doc = "id: 290"]
15012#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
15013#[derive(Debug, Clone, PartialEq)]
15014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15016pub struct ESC_INFO_DATA {
15017 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
15018 pub time_usec: u64,
15019 #[doc = "Number of reported errors by each ESC since boot."]
15020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15021 pub error_count: [u32; 4],
15022 #[doc = "Counter of data packets received."]
15023 pub counter: u16,
15024 #[doc = "Bitmap of ESC failure flags."]
15025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15026 pub failure_flags: [u16; 4],
15027 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
15028 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15029 pub temperature: [i16; 4],
15030 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
15031 pub index: u8,
15032 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
15033 pub count: u8,
15034 #[doc = "Connection type protocol for all ESC."]
15035 pub connection_type: EscConnectionType,
15036 #[doc = "Information regarding online/offline status of each ESC."]
15037 pub info: u8,
15038}
15039impl ESC_INFO_DATA {
15040 pub const ENCODED_LEN: usize = 46usize;
15041 pub const DEFAULT: Self = Self {
15042 time_usec: 0_u64,
15043 error_count: [0_u32; 4usize],
15044 counter: 0_u16,
15045 failure_flags: [0_u16; 4usize],
15046 temperature: [0_i16; 4usize],
15047 index: 0_u8,
15048 count: 0_u8,
15049 connection_type: EscConnectionType::DEFAULT,
15050 info: 0_u8,
15051 };
15052 #[cfg(feature = "arbitrary")]
15053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15054 use arbitrary::{Arbitrary, Unstructured};
15055 let mut buf = [0u8; 1024];
15056 rng.fill_bytes(&mut buf);
15057 let mut unstructured = Unstructured::new(&buf);
15058 Self::arbitrary(&mut unstructured).unwrap_or_default()
15059 }
15060}
15061impl Default for ESC_INFO_DATA {
15062 fn default() -> Self {
15063 Self::DEFAULT.clone()
15064 }
15065}
15066impl MessageData for ESC_INFO_DATA {
15067 type Message = MavMessage;
15068 const ID: u32 = 290u32;
15069 const NAME: &'static str = "ESC_INFO";
15070 const EXTRA_CRC: u8 = 251u8;
15071 const ENCODED_LEN: usize = 46usize;
15072 fn deser(
15073 _version: MavlinkVersion,
15074 __input: &[u8],
15075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15076 let avail_len = __input.len();
15077 let mut payload_buf = [0; Self::ENCODED_LEN];
15078 let mut buf = if avail_len < Self::ENCODED_LEN {
15079 payload_buf[0..avail_len].copy_from_slice(__input);
15080 Bytes::new(&payload_buf)
15081 } else {
15082 Bytes::new(__input)
15083 };
15084 let mut __struct = Self::default();
15085 __struct.time_usec = buf.get_u64_le();
15086 for v in &mut __struct.error_count {
15087 let val = buf.get_u32_le();
15088 *v = val;
15089 }
15090 __struct.counter = buf.get_u16_le();
15091 for v in &mut __struct.failure_flags {
15092 let val = buf.get_u16_le();
15093 *v = val;
15094 }
15095 for v in &mut __struct.temperature {
15096 let val = buf.get_i16_le();
15097 *v = val;
15098 }
15099 __struct.index = buf.get_u8();
15100 __struct.count = buf.get_u8();
15101 let tmp = buf.get_u8();
15102 __struct.connection_type =
15103 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15104 enum_type: "EscConnectionType",
15105 value: tmp as u32,
15106 })?;
15107 __struct.info = buf.get_u8();
15108 Ok(__struct)
15109 }
15110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15111 let mut __tmp = BytesMut::new(bytes);
15112 #[allow(clippy::absurd_extreme_comparisons)]
15113 #[allow(unused_comparisons)]
15114 if __tmp.remaining() < Self::ENCODED_LEN {
15115 panic!(
15116 "buffer is too small (need {} bytes, but got {})",
15117 Self::ENCODED_LEN,
15118 __tmp.remaining(),
15119 )
15120 }
15121 __tmp.put_u64_le(self.time_usec);
15122 for val in &self.error_count {
15123 __tmp.put_u32_le(*val);
15124 }
15125 __tmp.put_u16_le(self.counter);
15126 for val in &self.failure_flags {
15127 __tmp.put_u16_le(*val);
15128 }
15129 for val in &self.temperature {
15130 __tmp.put_i16_le(*val);
15131 }
15132 __tmp.put_u8(self.index);
15133 __tmp.put_u8(self.count);
15134 __tmp.put_u8(self.connection_type as u8);
15135 __tmp.put_u8(self.info);
15136 if matches!(version, MavlinkVersion::V2) {
15137 let len = __tmp.len();
15138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15139 } else {
15140 __tmp.len()
15141 }
15142 }
15143}
15144#[doc = "id: 291"]
15145#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
15146#[derive(Debug, Clone, PartialEq)]
15147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15149pub struct ESC_STATUS_DATA {
15150 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
15151 pub time_usec: u64,
15152 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
15153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15154 pub rpm: [i32; 4],
15155 #[doc = "Voltage measured from each ESC."]
15156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15157 pub voltage: [f32; 4],
15158 #[doc = "Current measured from each ESC."]
15159 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15160 pub current: [f32; 4],
15161 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
15162 pub index: u8,
15163}
15164impl ESC_STATUS_DATA {
15165 pub const ENCODED_LEN: usize = 57usize;
15166 pub const DEFAULT: Self = Self {
15167 time_usec: 0_u64,
15168 rpm: [0_i32; 4usize],
15169 voltage: [0.0_f32; 4usize],
15170 current: [0.0_f32; 4usize],
15171 index: 0_u8,
15172 };
15173 #[cfg(feature = "arbitrary")]
15174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15175 use arbitrary::{Arbitrary, Unstructured};
15176 let mut buf = [0u8; 1024];
15177 rng.fill_bytes(&mut buf);
15178 let mut unstructured = Unstructured::new(&buf);
15179 Self::arbitrary(&mut unstructured).unwrap_or_default()
15180 }
15181}
15182impl Default for ESC_STATUS_DATA {
15183 fn default() -> Self {
15184 Self::DEFAULT.clone()
15185 }
15186}
15187impl MessageData for ESC_STATUS_DATA {
15188 type Message = MavMessage;
15189 const ID: u32 = 291u32;
15190 const NAME: &'static str = "ESC_STATUS";
15191 const EXTRA_CRC: u8 = 10u8;
15192 const ENCODED_LEN: usize = 57usize;
15193 fn deser(
15194 _version: MavlinkVersion,
15195 __input: &[u8],
15196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15197 let avail_len = __input.len();
15198 let mut payload_buf = [0; Self::ENCODED_LEN];
15199 let mut buf = if avail_len < Self::ENCODED_LEN {
15200 payload_buf[0..avail_len].copy_from_slice(__input);
15201 Bytes::new(&payload_buf)
15202 } else {
15203 Bytes::new(__input)
15204 };
15205 let mut __struct = Self::default();
15206 __struct.time_usec = buf.get_u64_le();
15207 for v in &mut __struct.rpm {
15208 let val = buf.get_i32_le();
15209 *v = val;
15210 }
15211 for v in &mut __struct.voltage {
15212 let val = buf.get_f32_le();
15213 *v = val;
15214 }
15215 for v in &mut __struct.current {
15216 let val = buf.get_f32_le();
15217 *v = val;
15218 }
15219 __struct.index = buf.get_u8();
15220 Ok(__struct)
15221 }
15222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15223 let mut __tmp = BytesMut::new(bytes);
15224 #[allow(clippy::absurd_extreme_comparisons)]
15225 #[allow(unused_comparisons)]
15226 if __tmp.remaining() < Self::ENCODED_LEN {
15227 panic!(
15228 "buffer is too small (need {} bytes, but got {})",
15229 Self::ENCODED_LEN,
15230 __tmp.remaining(),
15231 )
15232 }
15233 __tmp.put_u64_le(self.time_usec);
15234 for val in &self.rpm {
15235 __tmp.put_i32_le(*val);
15236 }
15237 for val in &self.voltage {
15238 __tmp.put_f32_le(*val);
15239 }
15240 for val in &self.current {
15241 __tmp.put_f32_le(*val);
15242 }
15243 __tmp.put_u8(self.index);
15244 if matches!(version, MavlinkVersion::V2) {
15245 let len = __tmp.len();
15246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15247 } else {
15248 __tmp.len()
15249 }
15250 }
15251}
15252#[doc = "id: 11040"]
15253#[doc = "ESC Telemetry Data for ESCs 13 to 16, matching data sent by BLHeli ESCs."]
15254#[derive(Debug, Clone, PartialEq)]
15255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15257pub struct ESC_TELEMETRY_13_TO_16_DATA {
15258 #[doc = "Voltage."]
15259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15260 pub voltage: [u16; 4],
15261 #[doc = "Current."]
15262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15263 pub current: [u16; 4],
15264 #[doc = "Total current."]
15265 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15266 pub totalcurrent: [u16; 4],
15267 #[doc = "RPM (eRPM)."]
15268 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15269 pub rpm: [u16; 4],
15270 #[doc = "count of telemetry packets received (wraps at 65535)."]
15271 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15272 pub count: [u16; 4],
15273 #[doc = "Temperature."]
15274 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15275 pub temperature: [u8; 4],
15276}
15277impl ESC_TELEMETRY_13_TO_16_DATA {
15278 pub const ENCODED_LEN: usize = 44usize;
15279 pub const DEFAULT: Self = Self {
15280 voltage: [0_u16; 4usize],
15281 current: [0_u16; 4usize],
15282 totalcurrent: [0_u16; 4usize],
15283 rpm: [0_u16; 4usize],
15284 count: [0_u16; 4usize],
15285 temperature: [0_u8; 4usize],
15286 };
15287 #[cfg(feature = "arbitrary")]
15288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15289 use arbitrary::{Arbitrary, Unstructured};
15290 let mut buf = [0u8; 1024];
15291 rng.fill_bytes(&mut buf);
15292 let mut unstructured = Unstructured::new(&buf);
15293 Self::arbitrary(&mut unstructured).unwrap_or_default()
15294 }
15295}
15296impl Default for ESC_TELEMETRY_13_TO_16_DATA {
15297 fn default() -> Self {
15298 Self::DEFAULT.clone()
15299 }
15300}
15301impl MessageData for ESC_TELEMETRY_13_TO_16_DATA {
15302 type Message = MavMessage;
15303 const ID: u32 = 11040u32;
15304 const NAME: &'static str = "ESC_TELEMETRY_13_TO_16";
15305 const EXTRA_CRC: u8 = 132u8;
15306 const ENCODED_LEN: usize = 44usize;
15307 fn deser(
15308 _version: MavlinkVersion,
15309 __input: &[u8],
15310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15311 let avail_len = __input.len();
15312 let mut payload_buf = [0; Self::ENCODED_LEN];
15313 let mut buf = if avail_len < Self::ENCODED_LEN {
15314 payload_buf[0..avail_len].copy_from_slice(__input);
15315 Bytes::new(&payload_buf)
15316 } else {
15317 Bytes::new(__input)
15318 };
15319 let mut __struct = Self::default();
15320 for v in &mut __struct.voltage {
15321 let val = buf.get_u16_le();
15322 *v = val;
15323 }
15324 for v in &mut __struct.current {
15325 let val = buf.get_u16_le();
15326 *v = val;
15327 }
15328 for v in &mut __struct.totalcurrent {
15329 let val = buf.get_u16_le();
15330 *v = val;
15331 }
15332 for v in &mut __struct.rpm {
15333 let val = buf.get_u16_le();
15334 *v = val;
15335 }
15336 for v in &mut __struct.count {
15337 let val = buf.get_u16_le();
15338 *v = val;
15339 }
15340 for v in &mut __struct.temperature {
15341 let val = buf.get_u8();
15342 *v = val;
15343 }
15344 Ok(__struct)
15345 }
15346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15347 let mut __tmp = BytesMut::new(bytes);
15348 #[allow(clippy::absurd_extreme_comparisons)]
15349 #[allow(unused_comparisons)]
15350 if __tmp.remaining() < Self::ENCODED_LEN {
15351 panic!(
15352 "buffer is too small (need {} bytes, but got {})",
15353 Self::ENCODED_LEN,
15354 __tmp.remaining(),
15355 )
15356 }
15357 for val in &self.voltage {
15358 __tmp.put_u16_le(*val);
15359 }
15360 for val in &self.current {
15361 __tmp.put_u16_le(*val);
15362 }
15363 for val in &self.totalcurrent {
15364 __tmp.put_u16_le(*val);
15365 }
15366 for val in &self.rpm {
15367 __tmp.put_u16_le(*val);
15368 }
15369 for val in &self.count {
15370 __tmp.put_u16_le(*val);
15371 }
15372 for val in &self.temperature {
15373 __tmp.put_u8(*val);
15374 }
15375 if matches!(version, MavlinkVersion::V2) {
15376 let len = __tmp.len();
15377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15378 } else {
15379 __tmp.len()
15380 }
15381 }
15382}
15383#[doc = "id: 11041"]
15384#[doc = "ESC Telemetry Data for ESCs 17 to 20, matching data sent by BLHeli ESCs."]
15385#[derive(Debug, Clone, PartialEq)]
15386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15388pub struct ESC_TELEMETRY_17_TO_20_DATA {
15389 #[doc = "Voltage."]
15390 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15391 pub voltage: [u16; 4],
15392 #[doc = "Current."]
15393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15394 pub current: [u16; 4],
15395 #[doc = "Total current."]
15396 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15397 pub totalcurrent: [u16; 4],
15398 #[doc = "RPM (eRPM)."]
15399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15400 pub rpm: [u16; 4],
15401 #[doc = "count of telemetry packets received (wraps at 65535)."]
15402 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15403 pub count: [u16; 4],
15404 #[doc = "Temperature."]
15405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15406 pub temperature: [u8; 4],
15407}
15408impl ESC_TELEMETRY_17_TO_20_DATA {
15409 pub const ENCODED_LEN: usize = 44usize;
15410 pub const DEFAULT: Self = Self {
15411 voltage: [0_u16; 4usize],
15412 current: [0_u16; 4usize],
15413 totalcurrent: [0_u16; 4usize],
15414 rpm: [0_u16; 4usize],
15415 count: [0_u16; 4usize],
15416 temperature: [0_u8; 4usize],
15417 };
15418 #[cfg(feature = "arbitrary")]
15419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15420 use arbitrary::{Arbitrary, Unstructured};
15421 let mut buf = [0u8; 1024];
15422 rng.fill_bytes(&mut buf);
15423 let mut unstructured = Unstructured::new(&buf);
15424 Self::arbitrary(&mut unstructured).unwrap_or_default()
15425 }
15426}
15427impl Default for ESC_TELEMETRY_17_TO_20_DATA {
15428 fn default() -> Self {
15429 Self::DEFAULT.clone()
15430 }
15431}
15432impl MessageData for ESC_TELEMETRY_17_TO_20_DATA {
15433 type Message = MavMessage;
15434 const ID: u32 = 11041u32;
15435 const NAME: &'static str = "ESC_TELEMETRY_17_TO_20";
15436 const EXTRA_CRC: u8 = 208u8;
15437 const ENCODED_LEN: usize = 44usize;
15438 fn deser(
15439 _version: MavlinkVersion,
15440 __input: &[u8],
15441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15442 let avail_len = __input.len();
15443 let mut payload_buf = [0; Self::ENCODED_LEN];
15444 let mut buf = if avail_len < Self::ENCODED_LEN {
15445 payload_buf[0..avail_len].copy_from_slice(__input);
15446 Bytes::new(&payload_buf)
15447 } else {
15448 Bytes::new(__input)
15449 };
15450 let mut __struct = Self::default();
15451 for v in &mut __struct.voltage {
15452 let val = buf.get_u16_le();
15453 *v = val;
15454 }
15455 for v in &mut __struct.current {
15456 let val = buf.get_u16_le();
15457 *v = val;
15458 }
15459 for v in &mut __struct.totalcurrent {
15460 let val = buf.get_u16_le();
15461 *v = val;
15462 }
15463 for v in &mut __struct.rpm {
15464 let val = buf.get_u16_le();
15465 *v = val;
15466 }
15467 for v in &mut __struct.count {
15468 let val = buf.get_u16_le();
15469 *v = val;
15470 }
15471 for v in &mut __struct.temperature {
15472 let val = buf.get_u8();
15473 *v = val;
15474 }
15475 Ok(__struct)
15476 }
15477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15478 let mut __tmp = BytesMut::new(bytes);
15479 #[allow(clippy::absurd_extreme_comparisons)]
15480 #[allow(unused_comparisons)]
15481 if __tmp.remaining() < Self::ENCODED_LEN {
15482 panic!(
15483 "buffer is too small (need {} bytes, but got {})",
15484 Self::ENCODED_LEN,
15485 __tmp.remaining(),
15486 )
15487 }
15488 for val in &self.voltage {
15489 __tmp.put_u16_le(*val);
15490 }
15491 for val in &self.current {
15492 __tmp.put_u16_le(*val);
15493 }
15494 for val in &self.totalcurrent {
15495 __tmp.put_u16_le(*val);
15496 }
15497 for val in &self.rpm {
15498 __tmp.put_u16_le(*val);
15499 }
15500 for val in &self.count {
15501 __tmp.put_u16_le(*val);
15502 }
15503 for val in &self.temperature {
15504 __tmp.put_u8(*val);
15505 }
15506 if matches!(version, MavlinkVersion::V2) {
15507 let len = __tmp.len();
15508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15509 } else {
15510 __tmp.len()
15511 }
15512 }
15513}
15514#[doc = "id: 11030"]
15515#[doc = "ESC Telemetry Data for ESCs 1 to 4, matching data sent by BLHeli ESCs."]
15516#[derive(Debug, Clone, PartialEq)]
15517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15519pub struct ESC_TELEMETRY_1_TO_4_DATA {
15520 #[doc = "Voltage."]
15521 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15522 pub voltage: [u16; 4],
15523 #[doc = "Current."]
15524 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15525 pub current: [u16; 4],
15526 #[doc = "Total current."]
15527 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15528 pub totalcurrent: [u16; 4],
15529 #[doc = "RPM (eRPM)."]
15530 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15531 pub rpm: [u16; 4],
15532 #[doc = "count of telemetry packets received (wraps at 65535)."]
15533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15534 pub count: [u16; 4],
15535 #[doc = "Temperature."]
15536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15537 pub temperature: [u8; 4],
15538}
15539impl ESC_TELEMETRY_1_TO_4_DATA {
15540 pub const ENCODED_LEN: usize = 44usize;
15541 pub const DEFAULT: Self = Self {
15542 voltage: [0_u16; 4usize],
15543 current: [0_u16; 4usize],
15544 totalcurrent: [0_u16; 4usize],
15545 rpm: [0_u16; 4usize],
15546 count: [0_u16; 4usize],
15547 temperature: [0_u8; 4usize],
15548 };
15549 #[cfg(feature = "arbitrary")]
15550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15551 use arbitrary::{Arbitrary, Unstructured};
15552 let mut buf = [0u8; 1024];
15553 rng.fill_bytes(&mut buf);
15554 let mut unstructured = Unstructured::new(&buf);
15555 Self::arbitrary(&mut unstructured).unwrap_or_default()
15556 }
15557}
15558impl Default for ESC_TELEMETRY_1_TO_4_DATA {
15559 fn default() -> Self {
15560 Self::DEFAULT.clone()
15561 }
15562}
15563impl MessageData for ESC_TELEMETRY_1_TO_4_DATA {
15564 type Message = MavMessage;
15565 const ID: u32 = 11030u32;
15566 const NAME: &'static str = "ESC_TELEMETRY_1_TO_4";
15567 const EXTRA_CRC: u8 = 144u8;
15568 const ENCODED_LEN: usize = 44usize;
15569 fn deser(
15570 _version: MavlinkVersion,
15571 __input: &[u8],
15572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15573 let avail_len = __input.len();
15574 let mut payload_buf = [0; Self::ENCODED_LEN];
15575 let mut buf = if avail_len < Self::ENCODED_LEN {
15576 payload_buf[0..avail_len].copy_from_slice(__input);
15577 Bytes::new(&payload_buf)
15578 } else {
15579 Bytes::new(__input)
15580 };
15581 let mut __struct = Self::default();
15582 for v in &mut __struct.voltage {
15583 let val = buf.get_u16_le();
15584 *v = val;
15585 }
15586 for v in &mut __struct.current {
15587 let val = buf.get_u16_le();
15588 *v = val;
15589 }
15590 for v in &mut __struct.totalcurrent {
15591 let val = buf.get_u16_le();
15592 *v = val;
15593 }
15594 for v in &mut __struct.rpm {
15595 let val = buf.get_u16_le();
15596 *v = val;
15597 }
15598 for v in &mut __struct.count {
15599 let val = buf.get_u16_le();
15600 *v = val;
15601 }
15602 for v in &mut __struct.temperature {
15603 let val = buf.get_u8();
15604 *v = val;
15605 }
15606 Ok(__struct)
15607 }
15608 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15609 let mut __tmp = BytesMut::new(bytes);
15610 #[allow(clippy::absurd_extreme_comparisons)]
15611 #[allow(unused_comparisons)]
15612 if __tmp.remaining() < Self::ENCODED_LEN {
15613 panic!(
15614 "buffer is too small (need {} bytes, but got {})",
15615 Self::ENCODED_LEN,
15616 __tmp.remaining(),
15617 )
15618 }
15619 for val in &self.voltage {
15620 __tmp.put_u16_le(*val);
15621 }
15622 for val in &self.current {
15623 __tmp.put_u16_le(*val);
15624 }
15625 for val in &self.totalcurrent {
15626 __tmp.put_u16_le(*val);
15627 }
15628 for val in &self.rpm {
15629 __tmp.put_u16_le(*val);
15630 }
15631 for val in &self.count {
15632 __tmp.put_u16_le(*val);
15633 }
15634 for val in &self.temperature {
15635 __tmp.put_u8(*val);
15636 }
15637 if matches!(version, MavlinkVersion::V2) {
15638 let len = __tmp.len();
15639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15640 } else {
15641 __tmp.len()
15642 }
15643 }
15644}
15645#[doc = "id: 11042"]
15646#[doc = "ESC Telemetry Data for ESCs 21 to 24, matching data sent by BLHeli ESCs."]
15647#[derive(Debug, Clone, PartialEq)]
15648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15650pub struct ESC_TELEMETRY_21_TO_24_DATA {
15651 #[doc = "Voltage."]
15652 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15653 pub voltage: [u16; 4],
15654 #[doc = "Current."]
15655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15656 pub current: [u16; 4],
15657 #[doc = "Total current."]
15658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15659 pub totalcurrent: [u16; 4],
15660 #[doc = "RPM (eRPM)."]
15661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15662 pub rpm: [u16; 4],
15663 #[doc = "count of telemetry packets received (wraps at 65535)."]
15664 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15665 pub count: [u16; 4],
15666 #[doc = "Temperature."]
15667 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15668 pub temperature: [u8; 4],
15669}
15670impl ESC_TELEMETRY_21_TO_24_DATA {
15671 pub const ENCODED_LEN: usize = 44usize;
15672 pub const DEFAULT: Self = Self {
15673 voltage: [0_u16; 4usize],
15674 current: [0_u16; 4usize],
15675 totalcurrent: [0_u16; 4usize],
15676 rpm: [0_u16; 4usize],
15677 count: [0_u16; 4usize],
15678 temperature: [0_u8; 4usize],
15679 };
15680 #[cfg(feature = "arbitrary")]
15681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15682 use arbitrary::{Arbitrary, Unstructured};
15683 let mut buf = [0u8; 1024];
15684 rng.fill_bytes(&mut buf);
15685 let mut unstructured = Unstructured::new(&buf);
15686 Self::arbitrary(&mut unstructured).unwrap_or_default()
15687 }
15688}
15689impl Default for ESC_TELEMETRY_21_TO_24_DATA {
15690 fn default() -> Self {
15691 Self::DEFAULT.clone()
15692 }
15693}
15694impl MessageData for ESC_TELEMETRY_21_TO_24_DATA {
15695 type Message = MavMessage;
15696 const ID: u32 = 11042u32;
15697 const NAME: &'static str = "ESC_TELEMETRY_21_TO_24";
15698 const EXTRA_CRC: u8 = 201u8;
15699 const ENCODED_LEN: usize = 44usize;
15700 fn deser(
15701 _version: MavlinkVersion,
15702 __input: &[u8],
15703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15704 let avail_len = __input.len();
15705 let mut payload_buf = [0; Self::ENCODED_LEN];
15706 let mut buf = if avail_len < Self::ENCODED_LEN {
15707 payload_buf[0..avail_len].copy_from_slice(__input);
15708 Bytes::new(&payload_buf)
15709 } else {
15710 Bytes::new(__input)
15711 };
15712 let mut __struct = Self::default();
15713 for v in &mut __struct.voltage {
15714 let val = buf.get_u16_le();
15715 *v = val;
15716 }
15717 for v in &mut __struct.current {
15718 let val = buf.get_u16_le();
15719 *v = val;
15720 }
15721 for v in &mut __struct.totalcurrent {
15722 let val = buf.get_u16_le();
15723 *v = val;
15724 }
15725 for v in &mut __struct.rpm {
15726 let val = buf.get_u16_le();
15727 *v = val;
15728 }
15729 for v in &mut __struct.count {
15730 let val = buf.get_u16_le();
15731 *v = val;
15732 }
15733 for v in &mut __struct.temperature {
15734 let val = buf.get_u8();
15735 *v = val;
15736 }
15737 Ok(__struct)
15738 }
15739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15740 let mut __tmp = BytesMut::new(bytes);
15741 #[allow(clippy::absurd_extreme_comparisons)]
15742 #[allow(unused_comparisons)]
15743 if __tmp.remaining() < Self::ENCODED_LEN {
15744 panic!(
15745 "buffer is too small (need {} bytes, but got {})",
15746 Self::ENCODED_LEN,
15747 __tmp.remaining(),
15748 )
15749 }
15750 for val in &self.voltage {
15751 __tmp.put_u16_le(*val);
15752 }
15753 for val in &self.current {
15754 __tmp.put_u16_le(*val);
15755 }
15756 for val in &self.totalcurrent {
15757 __tmp.put_u16_le(*val);
15758 }
15759 for val in &self.rpm {
15760 __tmp.put_u16_le(*val);
15761 }
15762 for val in &self.count {
15763 __tmp.put_u16_le(*val);
15764 }
15765 for val in &self.temperature {
15766 __tmp.put_u8(*val);
15767 }
15768 if matches!(version, MavlinkVersion::V2) {
15769 let len = __tmp.len();
15770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15771 } else {
15772 __tmp.len()
15773 }
15774 }
15775}
15776#[doc = "id: 11043"]
15777#[doc = "ESC Telemetry Data for ESCs 25 to 28, matching data sent by BLHeli ESCs."]
15778#[derive(Debug, Clone, PartialEq)]
15779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15781pub struct ESC_TELEMETRY_25_TO_28_DATA {
15782 #[doc = "Voltage."]
15783 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15784 pub voltage: [u16; 4],
15785 #[doc = "Current."]
15786 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15787 pub current: [u16; 4],
15788 #[doc = "Total current."]
15789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15790 pub totalcurrent: [u16; 4],
15791 #[doc = "RPM (eRPM)."]
15792 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15793 pub rpm: [u16; 4],
15794 #[doc = "count of telemetry packets received (wraps at 65535)."]
15795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15796 pub count: [u16; 4],
15797 #[doc = "Temperature."]
15798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15799 pub temperature: [u8; 4],
15800}
15801impl ESC_TELEMETRY_25_TO_28_DATA {
15802 pub const ENCODED_LEN: usize = 44usize;
15803 pub const DEFAULT: Self = Self {
15804 voltage: [0_u16; 4usize],
15805 current: [0_u16; 4usize],
15806 totalcurrent: [0_u16; 4usize],
15807 rpm: [0_u16; 4usize],
15808 count: [0_u16; 4usize],
15809 temperature: [0_u8; 4usize],
15810 };
15811 #[cfg(feature = "arbitrary")]
15812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15813 use arbitrary::{Arbitrary, Unstructured};
15814 let mut buf = [0u8; 1024];
15815 rng.fill_bytes(&mut buf);
15816 let mut unstructured = Unstructured::new(&buf);
15817 Self::arbitrary(&mut unstructured).unwrap_or_default()
15818 }
15819}
15820impl Default for ESC_TELEMETRY_25_TO_28_DATA {
15821 fn default() -> Self {
15822 Self::DEFAULT.clone()
15823 }
15824}
15825impl MessageData for ESC_TELEMETRY_25_TO_28_DATA {
15826 type Message = MavMessage;
15827 const ID: u32 = 11043u32;
15828 const NAME: &'static str = "ESC_TELEMETRY_25_TO_28";
15829 const EXTRA_CRC: u8 = 193u8;
15830 const ENCODED_LEN: usize = 44usize;
15831 fn deser(
15832 _version: MavlinkVersion,
15833 __input: &[u8],
15834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15835 let avail_len = __input.len();
15836 let mut payload_buf = [0; Self::ENCODED_LEN];
15837 let mut buf = if avail_len < Self::ENCODED_LEN {
15838 payload_buf[0..avail_len].copy_from_slice(__input);
15839 Bytes::new(&payload_buf)
15840 } else {
15841 Bytes::new(__input)
15842 };
15843 let mut __struct = Self::default();
15844 for v in &mut __struct.voltage {
15845 let val = buf.get_u16_le();
15846 *v = val;
15847 }
15848 for v in &mut __struct.current {
15849 let val = buf.get_u16_le();
15850 *v = val;
15851 }
15852 for v in &mut __struct.totalcurrent {
15853 let val = buf.get_u16_le();
15854 *v = val;
15855 }
15856 for v in &mut __struct.rpm {
15857 let val = buf.get_u16_le();
15858 *v = val;
15859 }
15860 for v in &mut __struct.count {
15861 let val = buf.get_u16_le();
15862 *v = val;
15863 }
15864 for v in &mut __struct.temperature {
15865 let val = buf.get_u8();
15866 *v = val;
15867 }
15868 Ok(__struct)
15869 }
15870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15871 let mut __tmp = BytesMut::new(bytes);
15872 #[allow(clippy::absurd_extreme_comparisons)]
15873 #[allow(unused_comparisons)]
15874 if __tmp.remaining() < Self::ENCODED_LEN {
15875 panic!(
15876 "buffer is too small (need {} bytes, but got {})",
15877 Self::ENCODED_LEN,
15878 __tmp.remaining(),
15879 )
15880 }
15881 for val in &self.voltage {
15882 __tmp.put_u16_le(*val);
15883 }
15884 for val in &self.current {
15885 __tmp.put_u16_le(*val);
15886 }
15887 for val in &self.totalcurrent {
15888 __tmp.put_u16_le(*val);
15889 }
15890 for val in &self.rpm {
15891 __tmp.put_u16_le(*val);
15892 }
15893 for val in &self.count {
15894 __tmp.put_u16_le(*val);
15895 }
15896 for val in &self.temperature {
15897 __tmp.put_u8(*val);
15898 }
15899 if matches!(version, MavlinkVersion::V2) {
15900 let len = __tmp.len();
15901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15902 } else {
15903 __tmp.len()
15904 }
15905 }
15906}
15907#[doc = "id: 11044"]
15908#[doc = "ESC Telemetry Data for ESCs 29 to 32, matching data sent by BLHeli ESCs."]
15909#[derive(Debug, Clone, PartialEq)]
15910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15912pub struct ESC_TELEMETRY_29_TO_32_DATA {
15913 #[doc = "Voltage."]
15914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15915 pub voltage: [u16; 4],
15916 #[doc = "Current."]
15917 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15918 pub current: [u16; 4],
15919 #[doc = "Total current."]
15920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15921 pub totalcurrent: [u16; 4],
15922 #[doc = "RPM (eRPM)."]
15923 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15924 pub rpm: [u16; 4],
15925 #[doc = "count of telemetry packets received (wraps at 65535)."]
15926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15927 pub count: [u16; 4],
15928 #[doc = "Temperature."]
15929 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15930 pub temperature: [u8; 4],
15931}
15932impl ESC_TELEMETRY_29_TO_32_DATA {
15933 pub const ENCODED_LEN: usize = 44usize;
15934 pub const DEFAULT: Self = Self {
15935 voltage: [0_u16; 4usize],
15936 current: [0_u16; 4usize],
15937 totalcurrent: [0_u16; 4usize],
15938 rpm: [0_u16; 4usize],
15939 count: [0_u16; 4usize],
15940 temperature: [0_u8; 4usize],
15941 };
15942 #[cfg(feature = "arbitrary")]
15943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15944 use arbitrary::{Arbitrary, Unstructured};
15945 let mut buf = [0u8; 1024];
15946 rng.fill_bytes(&mut buf);
15947 let mut unstructured = Unstructured::new(&buf);
15948 Self::arbitrary(&mut unstructured).unwrap_or_default()
15949 }
15950}
15951impl Default for ESC_TELEMETRY_29_TO_32_DATA {
15952 fn default() -> Self {
15953 Self::DEFAULT.clone()
15954 }
15955}
15956impl MessageData for ESC_TELEMETRY_29_TO_32_DATA {
15957 type Message = MavMessage;
15958 const ID: u32 = 11044u32;
15959 const NAME: &'static str = "ESC_TELEMETRY_29_TO_32";
15960 const EXTRA_CRC: u8 = 189u8;
15961 const ENCODED_LEN: usize = 44usize;
15962 fn deser(
15963 _version: MavlinkVersion,
15964 __input: &[u8],
15965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15966 let avail_len = __input.len();
15967 let mut payload_buf = [0; Self::ENCODED_LEN];
15968 let mut buf = if avail_len < Self::ENCODED_LEN {
15969 payload_buf[0..avail_len].copy_from_slice(__input);
15970 Bytes::new(&payload_buf)
15971 } else {
15972 Bytes::new(__input)
15973 };
15974 let mut __struct = Self::default();
15975 for v in &mut __struct.voltage {
15976 let val = buf.get_u16_le();
15977 *v = val;
15978 }
15979 for v in &mut __struct.current {
15980 let val = buf.get_u16_le();
15981 *v = val;
15982 }
15983 for v in &mut __struct.totalcurrent {
15984 let val = buf.get_u16_le();
15985 *v = val;
15986 }
15987 for v in &mut __struct.rpm {
15988 let val = buf.get_u16_le();
15989 *v = val;
15990 }
15991 for v in &mut __struct.count {
15992 let val = buf.get_u16_le();
15993 *v = val;
15994 }
15995 for v in &mut __struct.temperature {
15996 let val = buf.get_u8();
15997 *v = val;
15998 }
15999 Ok(__struct)
16000 }
16001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16002 let mut __tmp = BytesMut::new(bytes);
16003 #[allow(clippy::absurd_extreme_comparisons)]
16004 #[allow(unused_comparisons)]
16005 if __tmp.remaining() < Self::ENCODED_LEN {
16006 panic!(
16007 "buffer is too small (need {} bytes, but got {})",
16008 Self::ENCODED_LEN,
16009 __tmp.remaining(),
16010 )
16011 }
16012 for val in &self.voltage {
16013 __tmp.put_u16_le(*val);
16014 }
16015 for val in &self.current {
16016 __tmp.put_u16_le(*val);
16017 }
16018 for val in &self.totalcurrent {
16019 __tmp.put_u16_le(*val);
16020 }
16021 for val in &self.rpm {
16022 __tmp.put_u16_le(*val);
16023 }
16024 for val in &self.count {
16025 __tmp.put_u16_le(*val);
16026 }
16027 for val in &self.temperature {
16028 __tmp.put_u8(*val);
16029 }
16030 if matches!(version, MavlinkVersion::V2) {
16031 let len = __tmp.len();
16032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16033 } else {
16034 __tmp.len()
16035 }
16036 }
16037}
16038#[doc = "id: 11031"]
16039#[doc = "ESC Telemetry Data for ESCs 5 to 8, matching data sent by BLHeli ESCs."]
16040#[derive(Debug, Clone, PartialEq)]
16041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16043pub struct ESC_TELEMETRY_5_TO_8_DATA {
16044 #[doc = "Voltage."]
16045 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16046 pub voltage: [u16; 4],
16047 #[doc = "Current."]
16048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16049 pub current: [u16; 4],
16050 #[doc = "Total current."]
16051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16052 pub totalcurrent: [u16; 4],
16053 #[doc = "RPM (eRPM)."]
16054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16055 pub rpm: [u16; 4],
16056 #[doc = "count of telemetry packets received (wraps at 65535)."]
16057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16058 pub count: [u16; 4],
16059 #[doc = "Temperature."]
16060 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16061 pub temperature: [u8; 4],
16062}
16063impl ESC_TELEMETRY_5_TO_8_DATA {
16064 pub const ENCODED_LEN: usize = 44usize;
16065 pub const DEFAULT: Self = Self {
16066 voltage: [0_u16; 4usize],
16067 current: [0_u16; 4usize],
16068 totalcurrent: [0_u16; 4usize],
16069 rpm: [0_u16; 4usize],
16070 count: [0_u16; 4usize],
16071 temperature: [0_u8; 4usize],
16072 };
16073 #[cfg(feature = "arbitrary")]
16074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16075 use arbitrary::{Arbitrary, Unstructured};
16076 let mut buf = [0u8; 1024];
16077 rng.fill_bytes(&mut buf);
16078 let mut unstructured = Unstructured::new(&buf);
16079 Self::arbitrary(&mut unstructured).unwrap_or_default()
16080 }
16081}
16082impl Default for ESC_TELEMETRY_5_TO_8_DATA {
16083 fn default() -> Self {
16084 Self::DEFAULT.clone()
16085 }
16086}
16087impl MessageData for ESC_TELEMETRY_5_TO_8_DATA {
16088 type Message = MavMessage;
16089 const ID: u32 = 11031u32;
16090 const NAME: &'static str = "ESC_TELEMETRY_5_TO_8";
16091 const EXTRA_CRC: u8 = 133u8;
16092 const ENCODED_LEN: usize = 44usize;
16093 fn deser(
16094 _version: MavlinkVersion,
16095 __input: &[u8],
16096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16097 let avail_len = __input.len();
16098 let mut payload_buf = [0; Self::ENCODED_LEN];
16099 let mut buf = if avail_len < Self::ENCODED_LEN {
16100 payload_buf[0..avail_len].copy_from_slice(__input);
16101 Bytes::new(&payload_buf)
16102 } else {
16103 Bytes::new(__input)
16104 };
16105 let mut __struct = Self::default();
16106 for v in &mut __struct.voltage {
16107 let val = buf.get_u16_le();
16108 *v = val;
16109 }
16110 for v in &mut __struct.current {
16111 let val = buf.get_u16_le();
16112 *v = val;
16113 }
16114 for v in &mut __struct.totalcurrent {
16115 let val = buf.get_u16_le();
16116 *v = val;
16117 }
16118 for v in &mut __struct.rpm {
16119 let val = buf.get_u16_le();
16120 *v = val;
16121 }
16122 for v in &mut __struct.count {
16123 let val = buf.get_u16_le();
16124 *v = val;
16125 }
16126 for v in &mut __struct.temperature {
16127 let val = buf.get_u8();
16128 *v = val;
16129 }
16130 Ok(__struct)
16131 }
16132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16133 let mut __tmp = BytesMut::new(bytes);
16134 #[allow(clippy::absurd_extreme_comparisons)]
16135 #[allow(unused_comparisons)]
16136 if __tmp.remaining() < Self::ENCODED_LEN {
16137 panic!(
16138 "buffer is too small (need {} bytes, but got {})",
16139 Self::ENCODED_LEN,
16140 __tmp.remaining(),
16141 )
16142 }
16143 for val in &self.voltage {
16144 __tmp.put_u16_le(*val);
16145 }
16146 for val in &self.current {
16147 __tmp.put_u16_le(*val);
16148 }
16149 for val in &self.totalcurrent {
16150 __tmp.put_u16_le(*val);
16151 }
16152 for val in &self.rpm {
16153 __tmp.put_u16_le(*val);
16154 }
16155 for val in &self.count {
16156 __tmp.put_u16_le(*val);
16157 }
16158 for val in &self.temperature {
16159 __tmp.put_u8(*val);
16160 }
16161 if matches!(version, MavlinkVersion::V2) {
16162 let len = __tmp.len();
16163 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16164 } else {
16165 __tmp.len()
16166 }
16167 }
16168}
16169#[doc = "id: 11032"]
16170#[doc = "ESC Telemetry Data for ESCs 9 to 12, matching data sent by BLHeli ESCs."]
16171#[derive(Debug, Clone, PartialEq)]
16172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16174pub struct ESC_TELEMETRY_9_TO_12_DATA {
16175 #[doc = "Voltage."]
16176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16177 pub voltage: [u16; 4],
16178 #[doc = "Current."]
16179 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16180 pub current: [u16; 4],
16181 #[doc = "Total current."]
16182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16183 pub totalcurrent: [u16; 4],
16184 #[doc = "RPM (eRPM)."]
16185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16186 pub rpm: [u16; 4],
16187 #[doc = "count of telemetry packets received (wraps at 65535)."]
16188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16189 pub count: [u16; 4],
16190 #[doc = "Temperature."]
16191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16192 pub temperature: [u8; 4],
16193}
16194impl ESC_TELEMETRY_9_TO_12_DATA {
16195 pub const ENCODED_LEN: usize = 44usize;
16196 pub const DEFAULT: Self = Self {
16197 voltage: [0_u16; 4usize],
16198 current: [0_u16; 4usize],
16199 totalcurrent: [0_u16; 4usize],
16200 rpm: [0_u16; 4usize],
16201 count: [0_u16; 4usize],
16202 temperature: [0_u8; 4usize],
16203 };
16204 #[cfg(feature = "arbitrary")]
16205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16206 use arbitrary::{Arbitrary, Unstructured};
16207 let mut buf = [0u8; 1024];
16208 rng.fill_bytes(&mut buf);
16209 let mut unstructured = Unstructured::new(&buf);
16210 Self::arbitrary(&mut unstructured).unwrap_or_default()
16211 }
16212}
16213impl Default for ESC_TELEMETRY_9_TO_12_DATA {
16214 fn default() -> Self {
16215 Self::DEFAULT.clone()
16216 }
16217}
16218impl MessageData for ESC_TELEMETRY_9_TO_12_DATA {
16219 type Message = MavMessage;
16220 const ID: u32 = 11032u32;
16221 const NAME: &'static str = "ESC_TELEMETRY_9_TO_12";
16222 const EXTRA_CRC: u8 = 85u8;
16223 const ENCODED_LEN: usize = 44usize;
16224 fn deser(
16225 _version: MavlinkVersion,
16226 __input: &[u8],
16227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16228 let avail_len = __input.len();
16229 let mut payload_buf = [0; Self::ENCODED_LEN];
16230 let mut buf = if avail_len < Self::ENCODED_LEN {
16231 payload_buf[0..avail_len].copy_from_slice(__input);
16232 Bytes::new(&payload_buf)
16233 } else {
16234 Bytes::new(__input)
16235 };
16236 let mut __struct = Self::default();
16237 for v in &mut __struct.voltage {
16238 let val = buf.get_u16_le();
16239 *v = val;
16240 }
16241 for v in &mut __struct.current {
16242 let val = buf.get_u16_le();
16243 *v = val;
16244 }
16245 for v in &mut __struct.totalcurrent {
16246 let val = buf.get_u16_le();
16247 *v = val;
16248 }
16249 for v in &mut __struct.rpm {
16250 let val = buf.get_u16_le();
16251 *v = val;
16252 }
16253 for v in &mut __struct.count {
16254 let val = buf.get_u16_le();
16255 *v = val;
16256 }
16257 for v in &mut __struct.temperature {
16258 let val = buf.get_u8();
16259 *v = val;
16260 }
16261 Ok(__struct)
16262 }
16263 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16264 let mut __tmp = BytesMut::new(bytes);
16265 #[allow(clippy::absurd_extreme_comparisons)]
16266 #[allow(unused_comparisons)]
16267 if __tmp.remaining() < Self::ENCODED_LEN {
16268 panic!(
16269 "buffer is too small (need {} bytes, but got {})",
16270 Self::ENCODED_LEN,
16271 __tmp.remaining(),
16272 )
16273 }
16274 for val in &self.voltage {
16275 __tmp.put_u16_le(*val);
16276 }
16277 for val in &self.current {
16278 __tmp.put_u16_le(*val);
16279 }
16280 for val in &self.totalcurrent {
16281 __tmp.put_u16_le(*val);
16282 }
16283 for val in &self.rpm {
16284 __tmp.put_u16_le(*val);
16285 }
16286 for val in &self.count {
16287 __tmp.put_u16_le(*val);
16288 }
16289 for val in &self.temperature {
16290 __tmp.put_u8(*val);
16291 }
16292 if matches!(version, MavlinkVersion::V2) {
16293 let len = __tmp.len();
16294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16295 } else {
16296 __tmp.len()
16297 }
16298 }
16299}
16300#[doc = "id: 230"]
16301#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
16302#[derive(Debug, Clone, PartialEq)]
16303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16305pub struct ESTIMATOR_STATUS_DATA {
16306 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16307 pub time_usec: u64,
16308 #[doc = "Velocity innovation test ratio"]
16309 pub vel_ratio: f32,
16310 #[doc = "Horizontal position innovation test ratio"]
16311 pub pos_horiz_ratio: f32,
16312 #[doc = "Vertical position innovation test ratio"]
16313 pub pos_vert_ratio: f32,
16314 #[doc = "Magnetometer innovation test ratio"]
16315 pub mag_ratio: f32,
16316 #[doc = "Height above terrain innovation test ratio"]
16317 pub hagl_ratio: f32,
16318 #[doc = "True airspeed innovation test ratio"]
16319 pub tas_ratio: f32,
16320 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
16321 pub pos_horiz_accuracy: f32,
16322 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
16323 pub pos_vert_accuracy: f32,
16324 #[doc = "Bitmap indicating which EKF outputs are valid."]
16325 pub flags: EstimatorStatusFlags,
16326}
16327impl ESTIMATOR_STATUS_DATA {
16328 pub const ENCODED_LEN: usize = 42usize;
16329 pub const DEFAULT: Self = Self {
16330 time_usec: 0_u64,
16331 vel_ratio: 0.0_f32,
16332 pos_horiz_ratio: 0.0_f32,
16333 pos_vert_ratio: 0.0_f32,
16334 mag_ratio: 0.0_f32,
16335 hagl_ratio: 0.0_f32,
16336 tas_ratio: 0.0_f32,
16337 pos_horiz_accuracy: 0.0_f32,
16338 pos_vert_accuracy: 0.0_f32,
16339 flags: EstimatorStatusFlags::DEFAULT,
16340 };
16341 #[cfg(feature = "arbitrary")]
16342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16343 use arbitrary::{Arbitrary, Unstructured};
16344 let mut buf = [0u8; 1024];
16345 rng.fill_bytes(&mut buf);
16346 let mut unstructured = Unstructured::new(&buf);
16347 Self::arbitrary(&mut unstructured).unwrap_or_default()
16348 }
16349}
16350impl Default for ESTIMATOR_STATUS_DATA {
16351 fn default() -> Self {
16352 Self::DEFAULT.clone()
16353 }
16354}
16355impl MessageData for ESTIMATOR_STATUS_DATA {
16356 type Message = MavMessage;
16357 const ID: u32 = 230u32;
16358 const NAME: &'static str = "ESTIMATOR_STATUS";
16359 const EXTRA_CRC: u8 = 163u8;
16360 const ENCODED_LEN: usize = 42usize;
16361 fn deser(
16362 _version: MavlinkVersion,
16363 __input: &[u8],
16364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16365 let avail_len = __input.len();
16366 let mut payload_buf = [0; Self::ENCODED_LEN];
16367 let mut buf = if avail_len < Self::ENCODED_LEN {
16368 payload_buf[0..avail_len].copy_from_slice(__input);
16369 Bytes::new(&payload_buf)
16370 } else {
16371 Bytes::new(__input)
16372 };
16373 let mut __struct = Self::default();
16374 __struct.time_usec = buf.get_u64_le();
16375 __struct.vel_ratio = buf.get_f32_le();
16376 __struct.pos_horiz_ratio = buf.get_f32_le();
16377 __struct.pos_vert_ratio = buf.get_f32_le();
16378 __struct.mag_ratio = buf.get_f32_le();
16379 __struct.hagl_ratio = buf.get_f32_le();
16380 __struct.tas_ratio = buf.get_f32_le();
16381 __struct.pos_horiz_accuracy = buf.get_f32_le();
16382 __struct.pos_vert_accuracy = buf.get_f32_le();
16383 let tmp = buf.get_u16_le();
16384 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
16385 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16386 flag_type: "EstimatorStatusFlags",
16387 value: tmp as u32,
16388 })?;
16389 Ok(__struct)
16390 }
16391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16392 let mut __tmp = BytesMut::new(bytes);
16393 #[allow(clippy::absurd_extreme_comparisons)]
16394 #[allow(unused_comparisons)]
16395 if __tmp.remaining() < Self::ENCODED_LEN {
16396 panic!(
16397 "buffer is too small (need {} bytes, but got {})",
16398 Self::ENCODED_LEN,
16399 __tmp.remaining(),
16400 )
16401 }
16402 __tmp.put_u64_le(self.time_usec);
16403 __tmp.put_f32_le(self.vel_ratio);
16404 __tmp.put_f32_le(self.pos_horiz_ratio);
16405 __tmp.put_f32_le(self.pos_vert_ratio);
16406 __tmp.put_f32_le(self.mag_ratio);
16407 __tmp.put_f32_le(self.hagl_ratio);
16408 __tmp.put_f32_le(self.tas_ratio);
16409 __tmp.put_f32_le(self.pos_horiz_accuracy);
16410 __tmp.put_f32_le(self.pos_vert_accuracy);
16411 __tmp.put_u16_le(self.flags.bits());
16412 if matches!(version, MavlinkVersion::V2) {
16413 let len = __tmp.len();
16414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16415 } else {
16416 __tmp.len()
16417 }
16418 }
16419}
16420#[doc = "id: 410"]
16421#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
16422#[derive(Debug, Clone, PartialEq)]
16423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16425pub struct EVENT_DATA {
16426 #[doc = "Event ID (as defined in the component metadata)"]
16427 pub id: u32,
16428 #[doc = "Timestamp (time since system boot when the event happened)."]
16429 pub event_time_boot_ms: u32,
16430 #[doc = "Sequence number."]
16431 pub sequence: u16,
16432 #[doc = "Component ID"]
16433 pub destination_component: u8,
16434 #[doc = "System ID"]
16435 pub destination_system: u8,
16436 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
16437 pub log_levels: u8,
16438 #[doc = "Arguments (depend on event ID)."]
16439 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16440 pub arguments: [u8; 40],
16441}
16442impl EVENT_DATA {
16443 pub const ENCODED_LEN: usize = 53usize;
16444 pub const DEFAULT: Self = Self {
16445 id: 0_u32,
16446 event_time_boot_ms: 0_u32,
16447 sequence: 0_u16,
16448 destination_component: 0_u8,
16449 destination_system: 0_u8,
16450 log_levels: 0_u8,
16451 arguments: [0_u8; 40usize],
16452 };
16453 #[cfg(feature = "arbitrary")]
16454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16455 use arbitrary::{Arbitrary, Unstructured};
16456 let mut buf = [0u8; 1024];
16457 rng.fill_bytes(&mut buf);
16458 let mut unstructured = Unstructured::new(&buf);
16459 Self::arbitrary(&mut unstructured).unwrap_or_default()
16460 }
16461}
16462impl Default for EVENT_DATA {
16463 fn default() -> Self {
16464 Self::DEFAULT.clone()
16465 }
16466}
16467impl MessageData for EVENT_DATA {
16468 type Message = MavMessage;
16469 const ID: u32 = 410u32;
16470 const NAME: &'static str = "EVENT";
16471 const EXTRA_CRC: u8 = 160u8;
16472 const ENCODED_LEN: usize = 53usize;
16473 fn deser(
16474 _version: MavlinkVersion,
16475 __input: &[u8],
16476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16477 let avail_len = __input.len();
16478 let mut payload_buf = [0; Self::ENCODED_LEN];
16479 let mut buf = if avail_len < Self::ENCODED_LEN {
16480 payload_buf[0..avail_len].copy_from_slice(__input);
16481 Bytes::new(&payload_buf)
16482 } else {
16483 Bytes::new(__input)
16484 };
16485 let mut __struct = Self::default();
16486 __struct.id = buf.get_u32_le();
16487 __struct.event_time_boot_ms = buf.get_u32_le();
16488 __struct.sequence = buf.get_u16_le();
16489 __struct.destination_component = buf.get_u8();
16490 __struct.destination_system = buf.get_u8();
16491 __struct.log_levels = buf.get_u8();
16492 for v in &mut __struct.arguments {
16493 let val = buf.get_u8();
16494 *v = val;
16495 }
16496 Ok(__struct)
16497 }
16498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16499 let mut __tmp = BytesMut::new(bytes);
16500 #[allow(clippy::absurd_extreme_comparisons)]
16501 #[allow(unused_comparisons)]
16502 if __tmp.remaining() < Self::ENCODED_LEN {
16503 panic!(
16504 "buffer is too small (need {} bytes, but got {})",
16505 Self::ENCODED_LEN,
16506 __tmp.remaining(),
16507 )
16508 }
16509 __tmp.put_u32_le(self.id);
16510 __tmp.put_u32_le(self.event_time_boot_ms);
16511 __tmp.put_u16_le(self.sequence);
16512 __tmp.put_u8(self.destination_component);
16513 __tmp.put_u8(self.destination_system);
16514 __tmp.put_u8(self.log_levels);
16515 for val in &self.arguments {
16516 __tmp.put_u8(*val);
16517 }
16518 if matches!(version, MavlinkVersion::V2) {
16519 let len = __tmp.len();
16520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16521 } else {
16522 __tmp.len()
16523 }
16524 }
16525}
16526#[doc = "id: 245"]
16527#[doc = "Provides state for additional features."]
16528#[derive(Debug, Clone, PartialEq)]
16529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16531pub struct EXTENDED_SYS_STATE_DATA {
16532 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
16533 pub vtol_state: MavVtolState,
16534 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16535 pub landed_state: MavLandedState,
16536}
16537impl EXTENDED_SYS_STATE_DATA {
16538 pub const ENCODED_LEN: usize = 2usize;
16539 pub const DEFAULT: Self = Self {
16540 vtol_state: MavVtolState::DEFAULT,
16541 landed_state: MavLandedState::DEFAULT,
16542 };
16543 #[cfg(feature = "arbitrary")]
16544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16545 use arbitrary::{Arbitrary, Unstructured};
16546 let mut buf = [0u8; 1024];
16547 rng.fill_bytes(&mut buf);
16548 let mut unstructured = Unstructured::new(&buf);
16549 Self::arbitrary(&mut unstructured).unwrap_or_default()
16550 }
16551}
16552impl Default for EXTENDED_SYS_STATE_DATA {
16553 fn default() -> Self {
16554 Self::DEFAULT.clone()
16555 }
16556}
16557impl MessageData for EXTENDED_SYS_STATE_DATA {
16558 type Message = MavMessage;
16559 const ID: u32 = 245u32;
16560 const NAME: &'static str = "EXTENDED_SYS_STATE";
16561 const EXTRA_CRC: u8 = 130u8;
16562 const ENCODED_LEN: usize = 2usize;
16563 fn deser(
16564 _version: MavlinkVersion,
16565 __input: &[u8],
16566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16567 let avail_len = __input.len();
16568 let mut payload_buf = [0; Self::ENCODED_LEN];
16569 let mut buf = if avail_len < Self::ENCODED_LEN {
16570 payload_buf[0..avail_len].copy_from_slice(__input);
16571 Bytes::new(&payload_buf)
16572 } else {
16573 Bytes::new(__input)
16574 };
16575 let mut __struct = Self::default();
16576 let tmp = buf.get_u8();
16577 __struct.vtol_state =
16578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16579 enum_type: "MavVtolState",
16580 value: tmp as u32,
16581 })?;
16582 let tmp = buf.get_u8();
16583 __struct.landed_state =
16584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16585 enum_type: "MavLandedState",
16586 value: tmp as u32,
16587 })?;
16588 Ok(__struct)
16589 }
16590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16591 let mut __tmp = BytesMut::new(bytes);
16592 #[allow(clippy::absurd_extreme_comparisons)]
16593 #[allow(unused_comparisons)]
16594 if __tmp.remaining() < Self::ENCODED_LEN {
16595 panic!(
16596 "buffer is too small (need {} bytes, but got {})",
16597 Self::ENCODED_LEN,
16598 __tmp.remaining(),
16599 )
16600 }
16601 __tmp.put_u8(self.vtol_state as u8);
16602 __tmp.put_u8(self.landed_state as u8);
16603 if matches!(version, MavlinkVersion::V2) {
16604 let len = __tmp.len();
16605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16606 } else {
16607 __tmp.len()
16608 }
16609 }
16610}
16611#[doc = "id: 161"]
16612#[doc = "Request a current fence point from MAV."]
16613#[derive(Debug, Clone, PartialEq)]
16614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16616pub struct FENCE_FETCH_POINT_DATA {
16617 #[doc = "System ID."]
16618 pub target_system: u8,
16619 #[doc = "Component ID."]
16620 pub target_component: u8,
16621 #[doc = "Point index (first point is 1, 0 is for return point)."]
16622 pub idx: u8,
16623}
16624impl FENCE_FETCH_POINT_DATA {
16625 pub const ENCODED_LEN: usize = 3usize;
16626 pub const DEFAULT: Self = Self {
16627 target_system: 0_u8,
16628 target_component: 0_u8,
16629 idx: 0_u8,
16630 };
16631 #[cfg(feature = "arbitrary")]
16632 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16633 use arbitrary::{Arbitrary, Unstructured};
16634 let mut buf = [0u8; 1024];
16635 rng.fill_bytes(&mut buf);
16636 let mut unstructured = Unstructured::new(&buf);
16637 Self::arbitrary(&mut unstructured).unwrap_or_default()
16638 }
16639}
16640impl Default for FENCE_FETCH_POINT_DATA {
16641 fn default() -> Self {
16642 Self::DEFAULT.clone()
16643 }
16644}
16645impl MessageData for FENCE_FETCH_POINT_DATA {
16646 type Message = MavMessage;
16647 const ID: u32 = 161u32;
16648 const NAME: &'static str = "FENCE_FETCH_POINT";
16649 const EXTRA_CRC: u8 = 68u8;
16650 const ENCODED_LEN: usize = 3usize;
16651 fn deser(
16652 _version: MavlinkVersion,
16653 __input: &[u8],
16654 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16655 let avail_len = __input.len();
16656 let mut payload_buf = [0; Self::ENCODED_LEN];
16657 let mut buf = if avail_len < Self::ENCODED_LEN {
16658 payload_buf[0..avail_len].copy_from_slice(__input);
16659 Bytes::new(&payload_buf)
16660 } else {
16661 Bytes::new(__input)
16662 };
16663 let mut __struct = Self::default();
16664 __struct.target_system = buf.get_u8();
16665 __struct.target_component = buf.get_u8();
16666 __struct.idx = buf.get_u8();
16667 Ok(__struct)
16668 }
16669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16670 let mut __tmp = BytesMut::new(bytes);
16671 #[allow(clippy::absurd_extreme_comparisons)]
16672 #[allow(unused_comparisons)]
16673 if __tmp.remaining() < Self::ENCODED_LEN {
16674 panic!(
16675 "buffer is too small (need {} bytes, but got {})",
16676 Self::ENCODED_LEN,
16677 __tmp.remaining(),
16678 )
16679 }
16680 __tmp.put_u8(self.target_system);
16681 __tmp.put_u8(self.target_component);
16682 __tmp.put_u8(self.idx);
16683 if matches!(version, MavlinkVersion::V2) {
16684 let len = __tmp.len();
16685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16686 } else {
16687 __tmp.len()
16688 }
16689 }
16690}
16691#[doc = "id: 160"]
16692#[doc = "GCS."]
16693#[derive(Debug, Clone, PartialEq)]
16694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16696pub struct FENCE_POINT_DATA {
16697 #[doc = "Latitude of point."]
16698 pub lat: f32,
16699 #[doc = "Longitude of point."]
16700 pub lng: f32,
16701 #[doc = "System ID."]
16702 pub target_system: u8,
16703 #[doc = "Component ID."]
16704 pub target_component: u8,
16705 #[doc = "Point index (first point is 1, 0 is for return point)."]
16706 pub idx: u8,
16707 #[doc = "Total number of points (for sanity checking)."]
16708 pub count: u8,
16709}
16710impl FENCE_POINT_DATA {
16711 pub const ENCODED_LEN: usize = 12usize;
16712 pub const DEFAULT: Self = Self {
16713 lat: 0.0_f32,
16714 lng: 0.0_f32,
16715 target_system: 0_u8,
16716 target_component: 0_u8,
16717 idx: 0_u8,
16718 count: 0_u8,
16719 };
16720 #[cfg(feature = "arbitrary")]
16721 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16722 use arbitrary::{Arbitrary, Unstructured};
16723 let mut buf = [0u8; 1024];
16724 rng.fill_bytes(&mut buf);
16725 let mut unstructured = Unstructured::new(&buf);
16726 Self::arbitrary(&mut unstructured).unwrap_or_default()
16727 }
16728}
16729impl Default for FENCE_POINT_DATA {
16730 fn default() -> Self {
16731 Self::DEFAULT.clone()
16732 }
16733}
16734impl MessageData for FENCE_POINT_DATA {
16735 type Message = MavMessage;
16736 const ID: u32 = 160u32;
16737 const NAME: &'static str = "FENCE_POINT";
16738 const EXTRA_CRC: u8 = 78u8;
16739 const ENCODED_LEN: usize = 12usize;
16740 fn deser(
16741 _version: MavlinkVersion,
16742 __input: &[u8],
16743 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16744 let avail_len = __input.len();
16745 let mut payload_buf = [0; Self::ENCODED_LEN];
16746 let mut buf = if avail_len < Self::ENCODED_LEN {
16747 payload_buf[0..avail_len].copy_from_slice(__input);
16748 Bytes::new(&payload_buf)
16749 } else {
16750 Bytes::new(__input)
16751 };
16752 let mut __struct = Self::default();
16753 __struct.lat = buf.get_f32_le();
16754 __struct.lng = buf.get_f32_le();
16755 __struct.target_system = buf.get_u8();
16756 __struct.target_component = buf.get_u8();
16757 __struct.idx = buf.get_u8();
16758 __struct.count = buf.get_u8();
16759 Ok(__struct)
16760 }
16761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16762 let mut __tmp = BytesMut::new(bytes);
16763 #[allow(clippy::absurd_extreme_comparisons)]
16764 #[allow(unused_comparisons)]
16765 if __tmp.remaining() < Self::ENCODED_LEN {
16766 panic!(
16767 "buffer is too small (need {} bytes, but got {})",
16768 Self::ENCODED_LEN,
16769 __tmp.remaining(),
16770 )
16771 }
16772 __tmp.put_f32_le(self.lat);
16773 __tmp.put_f32_le(self.lng);
16774 __tmp.put_u8(self.target_system);
16775 __tmp.put_u8(self.target_component);
16776 __tmp.put_u8(self.idx);
16777 __tmp.put_u8(self.count);
16778 if matches!(version, MavlinkVersion::V2) {
16779 let len = __tmp.len();
16780 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16781 } else {
16782 __tmp.len()
16783 }
16784 }
16785}
16786#[doc = "id: 162"]
16787#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
16788#[derive(Debug, Clone, PartialEq)]
16789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16791pub struct FENCE_STATUS_DATA {
16792 #[doc = "Time (since boot) of last breach."]
16793 pub breach_time: u32,
16794 #[doc = "Number of fence breaches."]
16795 pub breach_count: u16,
16796 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
16797 pub breach_status: u8,
16798 #[doc = "Last breach type."]
16799 pub breach_type: FenceBreach,
16800 #[doc = "Active action to prevent fence breach"]
16801 #[cfg_attr(feature = "serde", serde(default))]
16802 pub breach_mitigation: FenceMitigate,
16803}
16804impl FENCE_STATUS_DATA {
16805 pub const ENCODED_LEN: usize = 9usize;
16806 pub const DEFAULT: Self = Self {
16807 breach_time: 0_u32,
16808 breach_count: 0_u16,
16809 breach_status: 0_u8,
16810 breach_type: FenceBreach::DEFAULT,
16811 breach_mitigation: FenceMitigate::DEFAULT,
16812 };
16813 #[cfg(feature = "arbitrary")]
16814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16815 use arbitrary::{Arbitrary, Unstructured};
16816 let mut buf = [0u8; 1024];
16817 rng.fill_bytes(&mut buf);
16818 let mut unstructured = Unstructured::new(&buf);
16819 Self::arbitrary(&mut unstructured).unwrap_or_default()
16820 }
16821}
16822impl Default for FENCE_STATUS_DATA {
16823 fn default() -> Self {
16824 Self::DEFAULT.clone()
16825 }
16826}
16827impl MessageData for FENCE_STATUS_DATA {
16828 type Message = MavMessage;
16829 const ID: u32 = 162u32;
16830 const NAME: &'static str = "FENCE_STATUS";
16831 const EXTRA_CRC: u8 = 189u8;
16832 const ENCODED_LEN: usize = 9usize;
16833 fn deser(
16834 _version: MavlinkVersion,
16835 __input: &[u8],
16836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16837 let avail_len = __input.len();
16838 let mut payload_buf = [0; Self::ENCODED_LEN];
16839 let mut buf = if avail_len < Self::ENCODED_LEN {
16840 payload_buf[0..avail_len].copy_from_slice(__input);
16841 Bytes::new(&payload_buf)
16842 } else {
16843 Bytes::new(__input)
16844 };
16845 let mut __struct = Self::default();
16846 __struct.breach_time = buf.get_u32_le();
16847 __struct.breach_count = buf.get_u16_le();
16848 __struct.breach_status = buf.get_u8();
16849 let tmp = buf.get_u8();
16850 __struct.breach_type =
16851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16852 enum_type: "FenceBreach",
16853 value: tmp as u32,
16854 })?;
16855 let tmp = buf.get_u8();
16856 __struct.breach_mitigation =
16857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16858 enum_type: "FenceMitigate",
16859 value: tmp as u32,
16860 })?;
16861 Ok(__struct)
16862 }
16863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16864 let mut __tmp = BytesMut::new(bytes);
16865 #[allow(clippy::absurd_extreme_comparisons)]
16866 #[allow(unused_comparisons)]
16867 if __tmp.remaining() < Self::ENCODED_LEN {
16868 panic!(
16869 "buffer is too small (need {} bytes, but got {})",
16870 Self::ENCODED_LEN,
16871 __tmp.remaining(),
16872 )
16873 }
16874 __tmp.put_u32_le(self.breach_time);
16875 __tmp.put_u16_le(self.breach_count);
16876 __tmp.put_u8(self.breach_status);
16877 __tmp.put_u8(self.breach_type as u8);
16878 __tmp.put_u8(self.breach_mitigation as u8);
16879 if matches!(version, MavlinkVersion::V2) {
16880 let len = __tmp.len();
16881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16882 } else {
16883 __tmp.len()
16884 }
16885 }
16886}
16887#[doc = "id: 110"]
16888#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
16889#[derive(Debug, Clone, PartialEq)]
16890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16892pub struct FILE_TRANSFER_PROTOCOL_DATA {
16893 #[doc = "Network ID (0 for broadcast)"]
16894 pub target_network: u8,
16895 #[doc = "System ID (0 for broadcast)"]
16896 pub target_system: u8,
16897 #[doc = "Component ID (0 for broadcast)"]
16898 pub target_component: u8,
16899 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
16900 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16901 pub payload: [u8; 251],
16902}
16903impl FILE_TRANSFER_PROTOCOL_DATA {
16904 pub const ENCODED_LEN: usize = 254usize;
16905 pub const DEFAULT: Self = Self {
16906 target_network: 0_u8,
16907 target_system: 0_u8,
16908 target_component: 0_u8,
16909 payload: [0_u8; 251usize],
16910 };
16911 #[cfg(feature = "arbitrary")]
16912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16913 use arbitrary::{Arbitrary, Unstructured};
16914 let mut buf = [0u8; 1024];
16915 rng.fill_bytes(&mut buf);
16916 let mut unstructured = Unstructured::new(&buf);
16917 Self::arbitrary(&mut unstructured).unwrap_or_default()
16918 }
16919}
16920impl Default for FILE_TRANSFER_PROTOCOL_DATA {
16921 fn default() -> Self {
16922 Self::DEFAULT.clone()
16923 }
16924}
16925impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
16926 type Message = MavMessage;
16927 const ID: u32 = 110u32;
16928 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
16929 const EXTRA_CRC: u8 = 84u8;
16930 const ENCODED_LEN: usize = 254usize;
16931 fn deser(
16932 _version: MavlinkVersion,
16933 __input: &[u8],
16934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16935 let avail_len = __input.len();
16936 let mut payload_buf = [0; Self::ENCODED_LEN];
16937 let mut buf = if avail_len < Self::ENCODED_LEN {
16938 payload_buf[0..avail_len].copy_from_slice(__input);
16939 Bytes::new(&payload_buf)
16940 } else {
16941 Bytes::new(__input)
16942 };
16943 let mut __struct = Self::default();
16944 __struct.target_network = buf.get_u8();
16945 __struct.target_system = buf.get_u8();
16946 __struct.target_component = buf.get_u8();
16947 for v in &mut __struct.payload {
16948 let val = buf.get_u8();
16949 *v = val;
16950 }
16951 Ok(__struct)
16952 }
16953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16954 let mut __tmp = BytesMut::new(bytes);
16955 #[allow(clippy::absurd_extreme_comparisons)]
16956 #[allow(unused_comparisons)]
16957 if __tmp.remaining() < Self::ENCODED_LEN {
16958 panic!(
16959 "buffer is too small (need {} bytes, but got {})",
16960 Self::ENCODED_LEN,
16961 __tmp.remaining(),
16962 )
16963 }
16964 __tmp.put_u8(self.target_network);
16965 __tmp.put_u8(self.target_system);
16966 __tmp.put_u8(self.target_component);
16967 for val in &self.payload {
16968 __tmp.put_u8(*val);
16969 }
16970 if matches!(version, MavlinkVersion::V2) {
16971 let len = __tmp.len();
16972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16973 } else {
16974 __tmp.len()
16975 }
16976 }
16977}
16978#[doc = "id: 264"]
16979#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
16980#[derive(Debug, Clone, PartialEq)]
16981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16983pub struct FLIGHT_INFORMATION_DATA {
16984 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
16985 pub arming_time_utc: u64,
16986 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
16987 pub takeoff_time_utc: u64,
16988 #[doc = "Flight number. Note, field is misnamed UUID."]
16989 pub flight_uuid: u64,
16990 #[doc = "Timestamp (time since system boot)."]
16991 pub time_boot_ms: u32,
16992 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
16993 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16994 pub landing_time: u32,
16995}
16996impl FLIGHT_INFORMATION_DATA {
16997 pub const ENCODED_LEN: usize = 32usize;
16998 pub const DEFAULT: Self = Self {
16999 arming_time_utc: 0_u64,
17000 takeoff_time_utc: 0_u64,
17001 flight_uuid: 0_u64,
17002 time_boot_ms: 0_u32,
17003 landing_time: 0_u32,
17004 };
17005 #[cfg(feature = "arbitrary")]
17006 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17007 use arbitrary::{Arbitrary, Unstructured};
17008 let mut buf = [0u8; 1024];
17009 rng.fill_bytes(&mut buf);
17010 let mut unstructured = Unstructured::new(&buf);
17011 Self::arbitrary(&mut unstructured).unwrap_or_default()
17012 }
17013}
17014impl Default for FLIGHT_INFORMATION_DATA {
17015 fn default() -> Self {
17016 Self::DEFAULT.clone()
17017 }
17018}
17019impl MessageData for FLIGHT_INFORMATION_DATA {
17020 type Message = MavMessage;
17021 const ID: u32 = 264u32;
17022 const NAME: &'static str = "FLIGHT_INFORMATION";
17023 const EXTRA_CRC: u8 = 49u8;
17024 const ENCODED_LEN: usize = 32usize;
17025 fn deser(
17026 _version: MavlinkVersion,
17027 __input: &[u8],
17028 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17029 let avail_len = __input.len();
17030 let mut payload_buf = [0; Self::ENCODED_LEN];
17031 let mut buf = if avail_len < Self::ENCODED_LEN {
17032 payload_buf[0..avail_len].copy_from_slice(__input);
17033 Bytes::new(&payload_buf)
17034 } else {
17035 Bytes::new(__input)
17036 };
17037 let mut __struct = Self::default();
17038 __struct.arming_time_utc = buf.get_u64_le();
17039 __struct.takeoff_time_utc = buf.get_u64_le();
17040 __struct.flight_uuid = buf.get_u64_le();
17041 __struct.time_boot_ms = buf.get_u32_le();
17042 __struct.landing_time = buf.get_u32_le();
17043 Ok(__struct)
17044 }
17045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17046 let mut __tmp = BytesMut::new(bytes);
17047 #[allow(clippy::absurd_extreme_comparisons)]
17048 #[allow(unused_comparisons)]
17049 if __tmp.remaining() < Self::ENCODED_LEN {
17050 panic!(
17051 "buffer is too small (need {} bytes, but got {})",
17052 Self::ENCODED_LEN,
17053 __tmp.remaining(),
17054 )
17055 }
17056 __tmp.put_u64_le(self.arming_time_utc);
17057 __tmp.put_u64_le(self.takeoff_time_utc);
17058 __tmp.put_u64_le(self.flight_uuid);
17059 __tmp.put_u32_le(self.time_boot_ms);
17060 __tmp.put_u32_le(self.landing_time);
17061 if matches!(version, MavlinkVersion::V2) {
17062 let len = __tmp.len();
17063 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17064 } else {
17065 __tmp.len()
17066 }
17067 }
17068}
17069#[doc = "id: 144"]
17070#[doc = "Current motion information from a designated system."]
17071#[derive(Debug, Clone, PartialEq)]
17072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17074pub struct FOLLOW_TARGET_DATA {
17075 #[doc = "Timestamp (time since system boot)."]
17076 pub timestamp: u64,
17077 #[doc = "button states or switches of a tracker device"]
17078 pub custom_state: u64,
17079 #[doc = "Latitude (WGS84)"]
17080 pub lat: i32,
17081 #[doc = "Longitude (WGS84)"]
17082 pub lon: i32,
17083 #[doc = "Altitude (MSL)"]
17084 pub alt: f32,
17085 #[doc = "target velocity (0,0,0) for unknown"]
17086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17087 pub vel: [f32; 3],
17088 #[doc = "linear target acceleration (0,0,0) for unknown"]
17089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17090 pub acc: [f32; 3],
17091 #[doc = "(0 0 0 0 for unknown)"]
17092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17093 pub attitude_q: [f32; 4],
17094 #[doc = "(0 0 0 for unknown)"]
17095 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17096 pub rates: [f32; 3],
17097 #[doc = "eph epv"]
17098 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17099 pub position_cov: [f32; 3],
17100 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
17101 pub est_capabilities: u8,
17102}
17103impl FOLLOW_TARGET_DATA {
17104 pub const ENCODED_LEN: usize = 93usize;
17105 pub const DEFAULT: Self = Self {
17106 timestamp: 0_u64,
17107 custom_state: 0_u64,
17108 lat: 0_i32,
17109 lon: 0_i32,
17110 alt: 0.0_f32,
17111 vel: [0.0_f32; 3usize],
17112 acc: [0.0_f32; 3usize],
17113 attitude_q: [0.0_f32; 4usize],
17114 rates: [0.0_f32; 3usize],
17115 position_cov: [0.0_f32; 3usize],
17116 est_capabilities: 0_u8,
17117 };
17118 #[cfg(feature = "arbitrary")]
17119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17120 use arbitrary::{Arbitrary, Unstructured};
17121 let mut buf = [0u8; 1024];
17122 rng.fill_bytes(&mut buf);
17123 let mut unstructured = Unstructured::new(&buf);
17124 Self::arbitrary(&mut unstructured).unwrap_or_default()
17125 }
17126}
17127impl Default for FOLLOW_TARGET_DATA {
17128 fn default() -> Self {
17129 Self::DEFAULT.clone()
17130 }
17131}
17132impl MessageData for FOLLOW_TARGET_DATA {
17133 type Message = MavMessage;
17134 const ID: u32 = 144u32;
17135 const NAME: &'static str = "FOLLOW_TARGET";
17136 const EXTRA_CRC: u8 = 127u8;
17137 const ENCODED_LEN: usize = 93usize;
17138 fn deser(
17139 _version: MavlinkVersion,
17140 __input: &[u8],
17141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17142 let avail_len = __input.len();
17143 let mut payload_buf = [0; Self::ENCODED_LEN];
17144 let mut buf = if avail_len < Self::ENCODED_LEN {
17145 payload_buf[0..avail_len].copy_from_slice(__input);
17146 Bytes::new(&payload_buf)
17147 } else {
17148 Bytes::new(__input)
17149 };
17150 let mut __struct = Self::default();
17151 __struct.timestamp = buf.get_u64_le();
17152 __struct.custom_state = buf.get_u64_le();
17153 __struct.lat = buf.get_i32_le();
17154 __struct.lon = buf.get_i32_le();
17155 __struct.alt = buf.get_f32_le();
17156 for v in &mut __struct.vel {
17157 let val = buf.get_f32_le();
17158 *v = val;
17159 }
17160 for v in &mut __struct.acc {
17161 let val = buf.get_f32_le();
17162 *v = val;
17163 }
17164 for v in &mut __struct.attitude_q {
17165 let val = buf.get_f32_le();
17166 *v = val;
17167 }
17168 for v in &mut __struct.rates {
17169 let val = buf.get_f32_le();
17170 *v = val;
17171 }
17172 for v in &mut __struct.position_cov {
17173 let val = buf.get_f32_le();
17174 *v = val;
17175 }
17176 __struct.est_capabilities = buf.get_u8();
17177 Ok(__struct)
17178 }
17179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17180 let mut __tmp = BytesMut::new(bytes);
17181 #[allow(clippy::absurd_extreme_comparisons)]
17182 #[allow(unused_comparisons)]
17183 if __tmp.remaining() < Self::ENCODED_LEN {
17184 panic!(
17185 "buffer is too small (need {} bytes, but got {})",
17186 Self::ENCODED_LEN,
17187 __tmp.remaining(),
17188 )
17189 }
17190 __tmp.put_u64_le(self.timestamp);
17191 __tmp.put_u64_le(self.custom_state);
17192 __tmp.put_i32_le(self.lat);
17193 __tmp.put_i32_le(self.lon);
17194 __tmp.put_f32_le(self.alt);
17195 for val in &self.vel {
17196 __tmp.put_f32_le(*val);
17197 }
17198 for val in &self.acc {
17199 __tmp.put_f32_le(*val);
17200 }
17201 for val in &self.attitude_q {
17202 __tmp.put_f32_le(*val);
17203 }
17204 for val in &self.rates {
17205 __tmp.put_f32_le(*val);
17206 }
17207 for val in &self.position_cov {
17208 __tmp.put_f32_le(*val);
17209 }
17210 __tmp.put_u8(self.est_capabilities);
17211 if matches!(version, MavlinkVersion::V2) {
17212 let len = __tmp.len();
17213 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17214 } else {
17215 __tmp.len()
17216 }
17217 }
17218}
17219#[doc = "id: 371"]
17220#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
17221#[derive(Debug, Clone, PartialEq)]
17222#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17224pub struct FUEL_STATUS_DATA {
17225 #[doc = "Capacity when full. Must be provided."]
17226 pub maximum_fuel: f32,
17227 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
17228 pub consumed_fuel: f32,
17229 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
17230 pub remaining_fuel: f32,
17231 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
17232 pub flow_rate: f32,
17233 #[doc = "Fuel temperature. NaN: field not provided."]
17234 pub temperature: f32,
17235 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
17236 pub fuel_type: MavFuelType,
17237 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
17238 pub id: u8,
17239 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
17240 pub percent_remaining: u8,
17241}
17242impl FUEL_STATUS_DATA {
17243 pub const ENCODED_LEN: usize = 26usize;
17244 pub const DEFAULT: Self = Self {
17245 maximum_fuel: 0.0_f32,
17246 consumed_fuel: 0.0_f32,
17247 remaining_fuel: 0.0_f32,
17248 flow_rate: 0.0_f32,
17249 temperature: 0.0_f32,
17250 fuel_type: MavFuelType::DEFAULT,
17251 id: 0_u8,
17252 percent_remaining: 0_u8,
17253 };
17254 #[cfg(feature = "arbitrary")]
17255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17256 use arbitrary::{Arbitrary, Unstructured};
17257 let mut buf = [0u8; 1024];
17258 rng.fill_bytes(&mut buf);
17259 let mut unstructured = Unstructured::new(&buf);
17260 Self::arbitrary(&mut unstructured).unwrap_or_default()
17261 }
17262}
17263impl Default for FUEL_STATUS_DATA {
17264 fn default() -> Self {
17265 Self::DEFAULT.clone()
17266 }
17267}
17268impl MessageData for FUEL_STATUS_DATA {
17269 type Message = MavMessage;
17270 const ID: u32 = 371u32;
17271 const NAME: &'static str = "FUEL_STATUS";
17272 const EXTRA_CRC: u8 = 10u8;
17273 const ENCODED_LEN: usize = 26usize;
17274 fn deser(
17275 _version: MavlinkVersion,
17276 __input: &[u8],
17277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17278 let avail_len = __input.len();
17279 let mut payload_buf = [0; Self::ENCODED_LEN];
17280 let mut buf = if avail_len < Self::ENCODED_LEN {
17281 payload_buf[0..avail_len].copy_from_slice(__input);
17282 Bytes::new(&payload_buf)
17283 } else {
17284 Bytes::new(__input)
17285 };
17286 let mut __struct = Self::default();
17287 __struct.maximum_fuel = buf.get_f32_le();
17288 __struct.consumed_fuel = buf.get_f32_le();
17289 __struct.remaining_fuel = buf.get_f32_le();
17290 __struct.flow_rate = buf.get_f32_le();
17291 __struct.temperature = buf.get_f32_le();
17292 let tmp = buf.get_u32_le();
17293 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
17294 ::mavlink_core::error::ParserError::InvalidEnum {
17295 enum_type: "MavFuelType",
17296 value: tmp as u32,
17297 },
17298 )?;
17299 __struct.id = buf.get_u8();
17300 __struct.percent_remaining = buf.get_u8();
17301 Ok(__struct)
17302 }
17303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17304 let mut __tmp = BytesMut::new(bytes);
17305 #[allow(clippy::absurd_extreme_comparisons)]
17306 #[allow(unused_comparisons)]
17307 if __tmp.remaining() < Self::ENCODED_LEN {
17308 panic!(
17309 "buffer is too small (need {} bytes, but got {})",
17310 Self::ENCODED_LEN,
17311 __tmp.remaining(),
17312 )
17313 }
17314 __tmp.put_f32_le(self.maximum_fuel);
17315 __tmp.put_f32_le(self.consumed_fuel);
17316 __tmp.put_f32_le(self.remaining_fuel);
17317 __tmp.put_f32_le(self.flow_rate);
17318 __tmp.put_f32_le(self.temperature);
17319 __tmp.put_u32_le(self.fuel_type as u32);
17320 __tmp.put_u8(self.id);
17321 __tmp.put_u8(self.percent_remaining);
17322 if matches!(version, MavlinkVersion::V2) {
17323 let len = __tmp.len();
17324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17325 } else {
17326 __tmp.len()
17327 }
17328 }
17329}
17330#[doc = "id: 373"]
17331#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
17332#[derive(Debug, Clone, PartialEq)]
17333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17335pub struct GENERATOR_STATUS_DATA {
17336 #[doc = "Status flags."]
17337 pub status: MavGeneratorStatusFlag,
17338 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
17339 pub battery_current: f32,
17340 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
17341 pub load_current: f32,
17342 #[doc = "The power being generated. NaN: field not provided"]
17343 pub power_generated: f32,
17344 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
17345 pub bus_voltage: f32,
17346 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
17347 pub bat_current_setpoint: f32,
17348 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
17349 pub runtime: u32,
17350 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
17351 pub time_until_maintenance: i32,
17352 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
17353 pub generator_speed: u16,
17354 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
17355 pub rectifier_temperature: i16,
17356 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
17357 pub generator_temperature: i16,
17358}
17359impl GENERATOR_STATUS_DATA {
17360 pub const ENCODED_LEN: usize = 42usize;
17361 pub const DEFAULT: Self = Self {
17362 status: MavGeneratorStatusFlag::DEFAULT,
17363 battery_current: 0.0_f32,
17364 load_current: 0.0_f32,
17365 power_generated: 0.0_f32,
17366 bus_voltage: 0.0_f32,
17367 bat_current_setpoint: 0.0_f32,
17368 runtime: 0_u32,
17369 time_until_maintenance: 0_i32,
17370 generator_speed: 0_u16,
17371 rectifier_temperature: 0_i16,
17372 generator_temperature: 0_i16,
17373 };
17374 #[cfg(feature = "arbitrary")]
17375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17376 use arbitrary::{Arbitrary, Unstructured};
17377 let mut buf = [0u8; 1024];
17378 rng.fill_bytes(&mut buf);
17379 let mut unstructured = Unstructured::new(&buf);
17380 Self::arbitrary(&mut unstructured).unwrap_or_default()
17381 }
17382}
17383impl Default for GENERATOR_STATUS_DATA {
17384 fn default() -> Self {
17385 Self::DEFAULT.clone()
17386 }
17387}
17388impl MessageData for GENERATOR_STATUS_DATA {
17389 type Message = MavMessage;
17390 const ID: u32 = 373u32;
17391 const NAME: &'static str = "GENERATOR_STATUS";
17392 const EXTRA_CRC: u8 = 117u8;
17393 const ENCODED_LEN: usize = 42usize;
17394 fn deser(
17395 _version: MavlinkVersion,
17396 __input: &[u8],
17397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17398 let avail_len = __input.len();
17399 let mut payload_buf = [0; Self::ENCODED_LEN];
17400 let mut buf = if avail_len < Self::ENCODED_LEN {
17401 payload_buf[0..avail_len].copy_from_slice(__input);
17402 Bytes::new(&payload_buf)
17403 } else {
17404 Bytes::new(__input)
17405 };
17406 let mut __struct = Self::default();
17407 let tmp = buf.get_u64_le();
17408 __struct.status = MavGeneratorStatusFlag::from_bits(
17409 tmp & MavGeneratorStatusFlag::all().bits(),
17410 )
17411 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17412 flag_type: "MavGeneratorStatusFlag",
17413 value: tmp as u32,
17414 })?;
17415 __struct.battery_current = buf.get_f32_le();
17416 __struct.load_current = buf.get_f32_le();
17417 __struct.power_generated = buf.get_f32_le();
17418 __struct.bus_voltage = buf.get_f32_le();
17419 __struct.bat_current_setpoint = buf.get_f32_le();
17420 __struct.runtime = buf.get_u32_le();
17421 __struct.time_until_maintenance = buf.get_i32_le();
17422 __struct.generator_speed = buf.get_u16_le();
17423 __struct.rectifier_temperature = buf.get_i16_le();
17424 __struct.generator_temperature = buf.get_i16_le();
17425 Ok(__struct)
17426 }
17427 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17428 let mut __tmp = BytesMut::new(bytes);
17429 #[allow(clippy::absurd_extreme_comparisons)]
17430 #[allow(unused_comparisons)]
17431 if __tmp.remaining() < Self::ENCODED_LEN {
17432 panic!(
17433 "buffer is too small (need {} bytes, but got {})",
17434 Self::ENCODED_LEN,
17435 __tmp.remaining(),
17436 )
17437 }
17438 __tmp.put_u64_le(self.status.bits());
17439 __tmp.put_f32_le(self.battery_current);
17440 __tmp.put_f32_le(self.load_current);
17441 __tmp.put_f32_le(self.power_generated);
17442 __tmp.put_f32_le(self.bus_voltage);
17443 __tmp.put_f32_le(self.bat_current_setpoint);
17444 __tmp.put_u32_le(self.runtime);
17445 __tmp.put_i32_le(self.time_until_maintenance);
17446 __tmp.put_u16_le(self.generator_speed);
17447 __tmp.put_i16_le(self.rectifier_temperature);
17448 __tmp.put_i16_le(self.generator_temperature);
17449 if matches!(version, MavlinkVersion::V2) {
17450 let len = __tmp.len();
17451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17452 } else {
17453 __tmp.len()
17454 }
17455 }
17456}
17457#[doc = "id: 201"]
17458#[doc = "Control message for rate gimbal."]
17459#[derive(Debug, Clone, PartialEq)]
17460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17462pub struct GIMBAL_CONTROL_DATA {
17463 #[doc = "Demanded angular rate X."]
17464 pub demanded_rate_x: f32,
17465 #[doc = "Demanded angular rate Y."]
17466 pub demanded_rate_y: f32,
17467 #[doc = "Demanded angular rate Z."]
17468 pub demanded_rate_z: f32,
17469 #[doc = "System ID."]
17470 pub target_system: u8,
17471 #[doc = "Component ID."]
17472 pub target_component: u8,
17473}
17474impl GIMBAL_CONTROL_DATA {
17475 pub const ENCODED_LEN: usize = 14usize;
17476 pub const DEFAULT: Self = Self {
17477 demanded_rate_x: 0.0_f32,
17478 demanded_rate_y: 0.0_f32,
17479 demanded_rate_z: 0.0_f32,
17480 target_system: 0_u8,
17481 target_component: 0_u8,
17482 };
17483 #[cfg(feature = "arbitrary")]
17484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17485 use arbitrary::{Arbitrary, Unstructured};
17486 let mut buf = [0u8; 1024];
17487 rng.fill_bytes(&mut buf);
17488 let mut unstructured = Unstructured::new(&buf);
17489 Self::arbitrary(&mut unstructured).unwrap_or_default()
17490 }
17491}
17492impl Default for GIMBAL_CONTROL_DATA {
17493 fn default() -> Self {
17494 Self::DEFAULT.clone()
17495 }
17496}
17497impl MessageData for GIMBAL_CONTROL_DATA {
17498 type Message = MavMessage;
17499 const ID: u32 = 201u32;
17500 const NAME: &'static str = "GIMBAL_CONTROL";
17501 const EXTRA_CRC: u8 = 205u8;
17502 const ENCODED_LEN: usize = 14usize;
17503 fn deser(
17504 _version: MavlinkVersion,
17505 __input: &[u8],
17506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17507 let avail_len = __input.len();
17508 let mut payload_buf = [0; Self::ENCODED_LEN];
17509 let mut buf = if avail_len < Self::ENCODED_LEN {
17510 payload_buf[0..avail_len].copy_from_slice(__input);
17511 Bytes::new(&payload_buf)
17512 } else {
17513 Bytes::new(__input)
17514 };
17515 let mut __struct = Self::default();
17516 __struct.demanded_rate_x = buf.get_f32_le();
17517 __struct.demanded_rate_y = buf.get_f32_le();
17518 __struct.demanded_rate_z = buf.get_f32_le();
17519 __struct.target_system = buf.get_u8();
17520 __struct.target_component = buf.get_u8();
17521 Ok(__struct)
17522 }
17523 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17524 let mut __tmp = BytesMut::new(bytes);
17525 #[allow(clippy::absurd_extreme_comparisons)]
17526 #[allow(unused_comparisons)]
17527 if __tmp.remaining() < Self::ENCODED_LEN {
17528 panic!(
17529 "buffer is too small (need {} bytes, but got {})",
17530 Self::ENCODED_LEN,
17531 __tmp.remaining(),
17532 )
17533 }
17534 __tmp.put_f32_le(self.demanded_rate_x);
17535 __tmp.put_f32_le(self.demanded_rate_y);
17536 __tmp.put_f32_le(self.demanded_rate_z);
17537 __tmp.put_u8(self.target_system);
17538 __tmp.put_u8(self.target_component);
17539 if matches!(version, MavlinkVersion::V2) {
17540 let len = __tmp.len();
17541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17542 } else {
17543 __tmp.len()
17544 }
17545 }
17546}
17547#[doc = "id: 285"]
17548#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
17549#[derive(Debug, Clone, PartialEq)]
17550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17552pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
17553 #[doc = "Timestamp (time since system boot)."]
17554 pub time_boot_ms: u32,
17555 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
17556 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17557 pub q: [f32; 4],
17558 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
17559 pub angular_velocity_x: f32,
17560 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
17561 pub angular_velocity_y: f32,
17562 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
17563 pub angular_velocity_z: f32,
17564 #[doc = "Failure flags (0 for no failure)"]
17565 pub failure_flags: GimbalDeviceErrorFlags,
17566 #[doc = "Current gimbal flags set."]
17567 pub flags: GimbalDeviceFlags,
17568 #[doc = "System ID"]
17569 pub target_system: u8,
17570 #[doc = "Component ID"]
17571 pub target_component: u8,
17572 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
17573 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17574 pub delta_yaw: f32,
17575 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
17576 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17577 pub delta_yaw_velocity: f32,
17578 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
17579 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17580 pub gimbal_device_id: u8,
17581}
17582impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
17583 pub const ENCODED_LEN: usize = 49usize;
17584 pub const DEFAULT: Self = Self {
17585 time_boot_ms: 0_u32,
17586 q: [0.0_f32; 4usize],
17587 angular_velocity_x: 0.0_f32,
17588 angular_velocity_y: 0.0_f32,
17589 angular_velocity_z: 0.0_f32,
17590 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
17591 flags: GimbalDeviceFlags::DEFAULT,
17592 target_system: 0_u8,
17593 target_component: 0_u8,
17594 delta_yaw: 0.0_f32,
17595 delta_yaw_velocity: 0.0_f32,
17596 gimbal_device_id: 0_u8,
17597 };
17598 #[cfg(feature = "arbitrary")]
17599 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17600 use arbitrary::{Arbitrary, Unstructured};
17601 let mut buf = [0u8; 1024];
17602 rng.fill_bytes(&mut buf);
17603 let mut unstructured = Unstructured::new(&buf);
17604 Self::arbitrary(&mut unstructured).unwrap_or_default()
17605 }
17606}
17607impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
17608 fn default() -> Self {
17609 Self::DEFAULT.clone()
17610 }
17611}
17612impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
17613 type Message = MavMessage;
17614 const ID: u32 = 285u32;
17615 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
17616 const EXTRA_CRC: u8 = 137u8;
17617 const ENCODED_LEN: usize = 49usize;
17618 fn deser(
17619 _version: MavlinkVersion,
17620 __input: &[u8],
17621 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17622 let avail_len = __input.len();
17623 let mut payload_buf = [0; Self::ENCODED_LEN];
17624 let mut buf = if avail_len < Self::ENCODED_LEN {
17625 payload_buf[0..avail_len].copy_from_slice(__input);
17626 Bytes::new(&payload_buf)
17627 } else {
17628 Bytes::new(__input)
17629 };
17630 let mut __struct = Self::default();
17631 __struct.time_boot_ms = buf.get_u32_le();
17632 for v in &mut __struct.q {
17633 let val = buf.get_f32_le();
17634 *v = val;
17635 }
17636 __struct.angular_velocity_x = buf.get_f32_le();
17637 __struct.angular_velocity_y = buf.get_f32_le();
17638 __struct.angular_velocity_z = buf.get_f32_le();
17639 let tmp = buf.get_u32_le();
17640 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
17641 tmp & GimbalDeviceErrorFlags::all().bits(),
17642 )
17643 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17644 flag_type: "GimbalDeviceErrorFlags",
17645 value: tmp as u32,
17646 })?;
17647 let tmp = buf.get_u16_le();
17648 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
17649 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17650 flag_type: "GimbalDeviceFlags",
17651 value: tmp as u32,
17652 })?;
17653 __struct.target_system = buf.get_u8();
17654 __struct.target_component = buf.get_u8();
17655 __struct.delta_yaw = buf.get_f32_le();
17656 __struct.delta_yaw_velocity = buf.get_f32_le();
17657 __struct.gimbal_device_id = buf.get_u8();
17658 Ok(__struct)
17659 }
17660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17661 let mut __tmp = BytesMut::new(bytes);
17662 #[allow(clippy::absurd_extreme_comparisons)]
17663 #[allow(unused_comparisons)]
17664 if __tmp.remaining() < Self::ENCODED_LEN {
17665 panic!(
17666 "buffer is too small (need {} bytes, but got {})",
17667 Self::ENCODED_LEN,
17668 __tmp.remaining(),
17669 )
17670 }
17671 __tmp.put_u32_le(self.time_boot_ms);
17672 for val in &self.q {
17673 __tmp.put_f32_le(*val);
17674 }
17675 __tmp.put_f32_le(self.angular_velocity_x);
17676 __tmp.put_f32_le(self.angular_velocity_y);
17677 __tmp.put_f32_le(self.angular_velocity_z);
17678 __tmp.put_u32_le(self.failure_flags.bits());
17679 __tmp.put_u16_le(self.flags.bits());
17680 __tmp.put_u8(self.target_system);
17681 __tmp.put_u8(self.target_component);
17682 __tmp.put_f32_le(self.delta_yaw);
17683 __tmp.put_f32_le(self.delta_yaw_velocity);
17684 __tmp.put_u8(self.gimbal_device_id);
17685 if matches!(version, MavlinkVersion::V2) {
17686 let len = __tmp.len();
17687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17688 } else {
17689 __tmp.len()
17690 }
17691 }
17692}
17693#[doc = "id: 283"]
17694#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
17695#[derive(Debug, Clone, PartialEq)]
17696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17698pub struct GIMBAL_DEVICE_INFORMATION_DATA {
17699 #[doc = "UID of gimbal hardware (0 if unknown)."]
17700 pub uid: u64,
17701 #[doc = "Timestamp (time since system boot)."]
17702 pub time_boot_ms: u32,
17703 #[doc = "0xff)."]
17704 pub firmware_version: u32,
17705 #[doc = "0xff)."]
17706 pub hardware_version: u32,
17707 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
17708 pub roll_min: f32,
17709 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
17710 pub roll_max: f32,
17711 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
17712 pub pitch_min: f32,
17713 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
17714 pub pitch_max: f32,
17715 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
17716 pub yaw_min: f32,
17717 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
17718 pub yaw_max: f32,
17719 #[doc = "Bitmap of gimbal capability flags."]
17720 pub cap_flags: GimbalDeviceCapFlags,
17721 #[doc = "Bitmap for use for gimbal-specific capability flags."]
17722 pub custom_cap_flags: u16,
17723 #[doc = "Name of the gimbal vendor."]
17724 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17725 pub vendor_name: [u8; 32],
17726 #[doc = "Name of the gimbal model."]
17727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17728 pub model_name: [u8; 32],
17729 #[doc = "Custom name of the gimbal given to it by the user."]
17730 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17731 pub custom_name: [u8; 32],
17732 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
17733 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17734 pub gimbal_device_id: u8,
17735}
17736impl GIMBAL_DEVICE_INFORMATION_DATA {
17737 pub const ENCODED_LEN: usize = 145usize;
17738 pub const DEFAULT: Self = Self {
17739 uid: 0_u64,
17740 time_boot_ms: 0_u32,
17741 firmware_version: 0_u32,
17742 hardware_version: 0_u32,
17743 roll_min: 0.0_f32,
17744 roll_max: 0.0_f32,
17745 pitch_min: 0.0_f32,
17746 pitch_max: 0.0_f32,
17747 yaw_min: 0.0_f32,
17748 yaw_max: 0.0_f32,
17749 cap_flags: GimbalDeviceCapFlags::DEFAULT,
17750 custom_cap_flags: 0_u16,
17751 vendor_name: [0_u8; 32usize],
17752 model_name: [0_u8; 32usize],
17753 custom_name: [0_u8; 32usize],
17754 gimbal_device_id: 0_u8,
17755 };
17756 #[cfg(feature = "arbitrary")]
17757 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17758 use arbitrary::{Arbitrary, Unstructured};
17759 let mut buf = [0u8; 1024];
17760 rng.fill_bytes(&mut buf);
17761 let mut unstructured = Unstructured::new(&buf);
17762 Self::arbitrary(&mut unstructured).unwrap_or_default()
17763 }
17764}
17765impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
17766 fn default() -> Self {
17767 Self::DEFAULT.clone()
17768 }
17769}
17770impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
17771 type Message = MavMessage;
17772 const ID: u32 = 283u32;
17773 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
17774 const EXTRA_CRC: u8 = 74u8;
17775 const ENCODED_LEN: usize = 145usize;
17776 fn deser(
17777 _version: MavlinkVersion,
17778 __input: &[u8],
17779 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17780 let avail_len = __input.len();
17781 let mut payload_buf = [0; Self::ENCODED_LEN];
17782 let mut buf = if avail_len < Self::ENCODED_LEN {
17783 payload_buf[0..avail_len].copy_from_slice(__input);
17784 Bytes::new(&payload_buf)
17785 } else {
17786 Bytes::new(__input)
17787 };
17788 let mut __struct = Self::default();
17789 __struct.uid = buf.get_u64_le();
17790 __struct.time_boot_ms = buf.get_u32_le();
17791 __struct.firmware_version = buf.get_u32_le();
17792 __struct.hardware_version = buf.get_u32_le();
17793 __struct.roll_min = buf.get_f32_le();
17794 __struct.roll_max = buf.get_f32_le();
17795 __struct.pitch_min = buf.get_f32_le();
17796 __struct.pitch_max = buf.get_f32_le();
17797 __struct.yaw_min = buf.get_f32_le();
17798 __struct.yaw_max = buf.get_f32_le();
17799 let tmp = buf.get_u16_le();
17800 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
17801 tmp & GimbalDeviceCapFlags::all().bits(),
17802 )
17803 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17804 flag_type: "GimbalDeviceCapFlags",
17805 value: tmp as u32,
17806 })?;
17807 __struct.custom_cap_flags = buf.get_u16_le();
17808 for v in &mut __struct.vendor_name {
17809 let val = buf.get_u8();
17810 *v = val;
17811 }
17812 for v in &mut __struct.model_name {
17813 let val = buf.get_u8();
17814 *v = val;
17815 }
17816 for v in &mut __struct.custom_name {
17817 let val = buf.get_u8();
17818 *v = val;
17819 }
17820 __struct.gimbal_device_id = buf.get_u8();
17821 Ok(__struct)
17822 }
17823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17824 let mut __tmp = BytesMut::new(bytes);
17825 #[allow(clippy::absurd_extreme_comparisons)]
17826 #[allow(unused_comparisons)]
17827 if __tmp.remaining() < Self::ENCODED_LEN {
17828 panic!(
17829 "buffer is too small (need {} bytes, but got {})",
17830 Self::ENCODED_LEN,
17831 __tmp.remaining(),
17832 )
17833 }
17834 __tmp.put_u64_le(self.uid);
17835 __tmp.put_u32_le(self.time_boot_ms);
17836 __tmp.put_u32_le(self.firmware_version);
17837 __tmp.put_u32_le(self.hardware_version);
17838 __tmp.put_f32_le(self.roll_min);
17839 __tmp.put_f32_le(self.roll_max);
17840 __tmp.put_f32_le(self.pitch_min);
17841 __tmp.put_f32_le(self.pitch_max);
17842 __tmp.put_f32_le(self.yaw_min);
17843 __tmp.put_f32_le(self.yaw_max);
17844 __tmp.put_u16_le(self.cap_flags.bits());
17845 __tmp.put_u16_le(self.custom_cap_flags);
17846 for val in &self.vendor_name {
17847 __tmp.put_u8(*val);
17848 }
17849 for val in &self.model_name {
17850 __tmp.put_u8(*val);
17851 }
17852 for val in &self.custom_name {
17853 __tmp.put_u8(*val);
17854 }
17855 __tmp.put_u8(self.gimbal_device_id);
17856 if matches!(version, MavlinkVersion::V2) {
17857 let len = __tmp.len();
17858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17859 } else {
17860 __tmp.len()
17861 }
17862 }
17863}
17864#[doc = "id: 284"]
17865#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
17866#[derive(Debug, Clone, PartialEq)]
17867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17869pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
17870 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
17871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17872 pub q: [f32; 4],
17873 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
17874 pub angular_velocity_x: f32,
17875 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
17876 pub angular_velocity_y: f32,
17877 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
17878 pub angular_velocity_z: f32,
17879 #[doc = "Low level gimbal flags."]
17880 pub flags: GimbalDeviceFlags,
17881 #[doc = "System ID"]
17882 pub target_system: u8,
17883 #[doc = "Component ID"]
17884 pub target_component: u8,
17885}
17886impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
17887 pub const ENCODED_LEN: usize = 32usize;
17888 pub const DEFAULT: Self = Self {
17889 q: [0.0_f32; 4usize],
17890 angular_velocity_x: 0.0_f32,
17891 angular_velocity_y: 0.0_f32,
17892 angular_velocity_z: 0.0_f32,
17893 flags: GimbalDeviceFlags::DEFAULT,
17894 target_system: 0_u8,
17895 target_component: 0_u8,
17896 };
17897 #[cfg(feature = "arbitrary")]
17898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17899 use arbitrary::{Arbitrary, Unstructured};
17900 let mut buf = [0u8; 1024];
17901 rng.fill_bytes(&mut buf);
17902 let mut unstructured = Unstructured::new(&buf);
17903 Self::arbitrary(&mut unstructured).unwrap_or_default()
17904 }
17905}
17906impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
17907 fn default() -> Self {
17908 Self::DEFAULT.clone()
17909 }
17910}
17911impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
17912 type Message = MavMessage;
17913 const ID: u32 = 284u32;
17914 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
17915 const EXTRA_CRC: u8 = 99u8;
17916 const ENCODED_LEN: usize = 32usize;
17917 fn deser(
17918 _version: MavlinkVersion,
17919 __input: &[u8],
17920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17921 let avail_len = __input.len();
17922 let mut payload_buf = [0; Self::ENCODED_LEN];
17923 let mut buf = if avail_len < Self::ENCODED_LEN {
17924 payload_buf[0..avail_len].copy_from_slice(__input);
17925 Bytes::new(&payload_buf)
17926 } else {
17927 Bytes::new(__input)
17928 };
17929 let mut __struct = Self::default();
17930 for v in &mut __struct.q {
17931 let val = buf.get_f32_le();
17932 *v = val;
17933 }
17934 __struct.angular_velocity_x = buf.get_f32_le();
17935 __struct.angular_velocity_y = buf.get_f32_le();
17936 __struct.angular_velocity_z = buf.get_f32_le();
17937 let tmp = buf.get_u16_le();
17938 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
17939 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17940 flag_type: "GimbalDeviceFlags",
17941 value: tmp as u32,
17942 })?;
17943 __struct.target_system = buf.get_u8();
17944 __struct.target_component = buf.get_u8();
17945 Ok(__struct)
17946 }
17947 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17948 let mut __tmp = BytesMut::new(bytes);
17949 #[allow(clippy::absurd_extreme_comparisons)]
17950 #[allow(unused_comparisons)]
17951 if __tmp.remaining() < Self::ENCODED_LEN {
17952 panic!(
17953 "buffer is too small (need {} bytes, but got {})",
17954 Self::ENCODED_LEN,
17955 __tmp.remaining(),
17956 )
17957 }
17958 for val in &self.q {
17959 __tmp.put_f32_le(*val);
17960 }
17961 __tmp.put_f32_le(self.angular_velocity_x);
17962 __tmp.put_f32_le(self.angular_velocity_y);
17963 __tmp.put_f32_le(self.angular_velocity_z);
17964 __tmp.put_u16_le(self.flags.bits());
17965 __tmp.put_u8(self.target_system);
17966 __tmp.put_u8(self.target_component);
17967 if matches!(version, MavlinkVersion::V2) {
17968 let len = __tmp.len();
17969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17970 } else {
17971 __tmp.len()
17972 }
17973 }
17974}
17975#[doc = "id: 280"]
17976#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
17977#[derive(Debug, Clone, PartialEq)]
17978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17980pub struct GIMBAL_MANAGER_INFORMATION_DATA {
17981 #[doc = "Timestamp (time since system boot)."]
17982 pub time_boot_ms: u32,
17983 #[doc = "Bitmap of gimbal capability flags."]
17984 pub cap_flags: GimbalManagerCapFlags,
17985 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
17986 pub roll_min: f32,
17987 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
17988 pub roll_max: f32,
17989 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
17990 pub pitch_min: f32,
17991 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
17992 pub pitch_max: f32,
17993 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
17994 pub yaw_min: f32,
17995 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
17996 pub yaw_max: f32,
17997 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
17998 pub gimbal_device_id: u8,
17999}
18000impl GIMBAL_MANAGER_INFORMATION_DATA {
18001 pub const ENCODED_LEN: usize = 33usize;
18002 pub const DEFAULT: Self = Self {
18003 time_boot_ms: 0_u32,
18004 cap_flags: GimbalManagerCapFlags::DEFAULT,
18005 roll_min: 0.0_f32,
18006 roll_max: 0.0_f32,
18007 pitch_min: 0.0_f32,
18008 pitch_max: 0.0_f32,
18009 yaw_min: 0.0_f32,
18010 yaw_max: 0.0_f32,
18011 gimbal_device_id: 0_u8,
18012 };
18013 #[cfg(feature = "arbitrary")]
18014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18015 use arbitrary::{Arbitrary, Unstructured};
18016 let mut buf = [0u8; 1024];
18017 rng.fill_bytes(&mut buf);
18018 let mut unstructured = Unstructured::new(&buf);
18019 Self::arbitrary(&mut unstructured).unwrap_or_default()
18020 }
18021}
18022impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
18023 fn default() -> Self {
18024 Self::DEFAULT.clone()
18025 }
18026}
18027impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
18028 type Message = MavMessage;
18029 const ID: u32 = 280u32;
18030 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
18031 const EXTRA_CRC: u8 = 70u8;
18032 const ENCODED_LEN: usize = 33usize;
18033 fn deser(
18034 _version: MavlinkVersion,
18035 __input: &[u8],
18036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18037 let avail_len = __input.len();
18038 let mut payload_buf = [0; Self::ENCODED_LEN];
18039 let mut buf = if avail_len < Self::ENCODED_LEN {
18040 payload_buf[0..avail_len].copy_from_slice(__input);
18041 Bytes::new(&payload_buf)
18042 } else {
18043 Bytes::new(__input)
18044 };
18045 let mut __struct = Self::default();
18046 __struct.time_boot_ms = buf.get_u32_le();
18047 let tmp = buf.get_u32_le();
18048 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
18049 tmp & GimbalManagerCapFlags::all().bits(),
18050 )
18051 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18052 flag_type: "GimbalManagerCapFlags",
18053 value: tmp as u32,
18054 })?;
18055 __struct.roll_min = buf.get_f32_le();
18056 __struct.roll_max = buf.get_f32_le();
18057 __struct.pitch_min = buf.get_f32_le();
18058 __struct.pitch_max = buf.get_f32_le();
18059 __struct.yaw_min = buf.get_f32_le();
18060 __struct.yaw_max = buf.get_f32_le();
18061 __struct.gimbal_device_id = buf.get_u8();
18062 Ok(__struct)
18063 }
18064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18065 let mut __tmp = BytesMut::new(bytes);
18066 #[allow(clippy::absurd_extreme_comparisons)]
18067 #[allow(unused_comparisons)]
18068 if __tmp.remaining() < Self::ENCODED_LEN {
18069 panic!(
18070 "buffer is too small (need {} bytes, but got {})",
18071 Self::ENCODED_LEN,
18072 __tmp.remaining(),
18073 )
18074 }
18075 __tmp.put_u32_le(self.time_boot_ms);
18076 __tmp.put_u32_le(self.cap_flags.bits());
18077 __tmp.put_f32_le(self.roll_min);
18078 __tmp.put_f32_le(self.roll_max);
18079 __tmp.put_f32_le(self.pitch_min);
18080 __tmp.put_f32_le(self.pitch_max);
18081 __tmp.put_f32_le(self.yaw_min);
18082 __tmp.put_f32_le(self.yaw_max);
18083 __tmp.put_u8(self.gimbal_device_id);
18084 if matches!(version, MavlinkVersion::V2) {
18085 let len = __tmp.len();
18086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18087 } else {
18088 __tmp.len()
18089 }
18090 }
18091}
18092#[doc = "id: 282"]
18093#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
18094#[derive(Debug, Clone, PartialEq)]
18095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18097pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18098 #[doc = "High level gimbal manager flags to use."]
18099 pub flags: GimbalManagerFlags,
18100 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
18101 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18102 pub q: [f32; 4],
18103 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
18104 pub angular_velocity_x: f32,
18105 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
18106 pub angular_velocity_y: f32,
18107 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
18108 pub angular_velocity_z: f32,
18109 #[doc = "System ID"]
18110 pub target_system: u8,
18111 #[doc = "Component ID"]
18112 pub target_component: u8,
18113 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
18114 pub gimbal_device_id: u8,
18115}
18116impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18117 pub const ENCODED_LEN: usize = 35usize;
18118 pub const DEFAULT: Self = Self {
18119 flags: GimbalManagerFlags::DEFAULT,
18120 q: [0.0_f32; 4usize],
18121 angular_velocity_x: 0.0_f32,
18122 angular_velocity_y: 0.0_f32,
18123 angular_velocity_z: 0.0_f32,
18124 target_system: 0_u8,
18125 target_component: 0_u8,
18126 gimbal_device_id: 0_u8,
18127 };
18128 #[cfg(feature = "arbitrary")]
18129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18130 use arbitrary::{Arbitrary, Unstructured};
18131 let mut buf = [0u8; 1024];
18132 rng.fill_bytes(&mut buf);
18133 let mut unstructured = Unstructured::new(&buf);
18134 Self::arbitrary(&mut unstructured).unwrap_or_default()
18135 }
18136}
18137impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18138 fn default() -> Self {
18139 Self::DEFAULT.clone()
18140 }
18141}
18142impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
18143 type Message = MavMessage;
18144 const ID: u32 = 282u32;
18145 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
18146 const EXTRA_CRC: u8 = 123u8;
18147 const ENCODED_LEN: usize = 35usize;
18148 fn deser(
18149 _version: MavlinkVersion,
18150 __input: &[u8],
18151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18152 let avail_len = __input.len();
18153 let mut payload_buf = [0; Self::ENCODED_LEN];
18154 let mut buf = if avail_len < Self::ENCODED_LEN {
18155 payload_buf[0..avail_len].copy_from_slice(__input);
18156 Bytes::new(&payload_buf)
18157 } else {
18158 Bytes::new(__input)
18159 };
18160 let mut __struct = Self::default();
18161 let tmp = buf.get_u32_le();
18162 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18163 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18164 flag_type: "GimbalManagerFlags",
18165 value: tmp as u32,
18166 })?;
18167 for v in &mut __struct.q {
18168 let val = buf.get_f32_le();
18169 *v = val;
18170 }
18171 __struct.angular_velocity_x = buf.get_f32_le();
18172 __struct.angular_velocity_y = buf.get_f32_le();
18173 __struct.angular_velocity_z = buf.get_f32_le();
18174 __struct.target_system = buf.get_u8();
18175 __struct.target_component = buf.get_u8();
18176 __struct.gimbal_device_id = buf.get_u8();
18177 Ok(__struct)
18178 }
18179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18180 let mut __tmp = BytesMut::new(bytes);
18181 #[allow(clippy::absurd_extreme_comparisons)]
18182 #[allow(unused_comparisons)]
18183 if __tmp.remaining() < Self::ENCODED_LEN {
18184 panic!(
18185 "buffer is too small (need {} bytes, but got {})",
18186 Self::ENCODED_LEN,
18187 __tmp.remaining(),
18188 )
18189 }
18190 __tmp.put_u32_le(self.flags.bits());
18191 for val in &self.q {
18192 __tmp.put_f32_le(*val);
18193 }
18194 __tmp.put_f32_le(self.angular_velocity_x);
18195 __tmp.put_f32_le(self.angular_velocity_y);
18196 __tmp.put_f32_le(self.angular_velocity_z);
18197 __tmp.put_u8(self.target_system);
18198 __tmp.put_u8(self.target_component);
18199 __tmp.put_u8(self.gimbal_device_id);
18200 if matches!(version, MavlinkVersion::V2) {
18201 let len = __tmp.len();
18202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18203 } else {
18204 __tmp.len()
18205 }
18206 }
18207}
18208#[doc = "id: 288"]
18209#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
18210#[derive(Debug, Clone, PartialEq)]
18211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18213pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18214 #[doc = "High level gimbal manager flags."]
18215 pub flags: GimbalManagerFlags,
18216 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
18217 pub pitch: f32,
18218 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
18219 pub yaw: f32,
18220 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
18221 pub pitch_rate: f32,
18222 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
18223 pub yaw_rate: f32,
18224 #[doc = "System ID"]
18225 pub target_system: u8,
18226 #[doc = "Component ID"]
18227 pub target_component: u8,
18228 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
18229 pub gimbal_device_id: u8,
18230}
18231impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18232 pub const ENCODED_LEN: usize = 23usize;
18233 pub const DEFAULT: Self = Self {
18234 flags: GimbalManagerFlags::DEFAULT,
18235 pitch: 0.0_f32,
18236 yaw: 0.0_f32,
18237 pitch_rate: 0.0_f32,
18238 yaw_rate: 0.0_f32,
18239 target_system: 0_u8,
18240 target_component: 0_u8,
18241 gimbal_device_id: 0_u8,
18242 };
18243 #[cfg(feature = "arbitrary")]
18244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18245 use arbitrary::{Arbitrary, Unstructured};
18246 let mut buf = [0u8; 1024];
18247 rng.fill_bytes(&mut buf);
18248 let mut unstructured = Unstructured::new(&buf);
18249 Self::arbitrary(&mut unstructured).unwrap_or_default()
18250 }
18251}
18252impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18253 fn default() -> Self {
18254 Self::DEFAULT.clone()
18255 }
18256}
18257impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18258 type Message = MavMessage;
18259 const ID: u32 = 288u32;
18260 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
18261 const EXTRA_CRC: u8 = 20u8;
18262 const ENCODED_LEN: usize = 23usize;
18263 fn deser(
18264 _version: MavlinkVersion,
18265 __input: &[u8],
18266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18267 let avail_len = __input.len();
18268 let mut payload_buf = [0; Self::ENCODED_LEN];
18269 let mut buf = if avail_len < Self::ENCODED_LEN {
18270 payload_buf[0..avail_len].copy_from_slice(__input);
18271 Bytes::new(&payload_buf)
18272 } else {
18273 Bytes::new(__input)
18274 };
18275 let mut __struct = Self::default();
18276 let tmp = buf.get_u32_le();
18277 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18278 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18279 flag_type: "GimbalManagerFlags",
18280 value: tmp as u32,
18281 })?;
18282 __struct.pitch = buf.get_f32_le();
18283 __struct.yaw = buf.get_f32_le();
18284 __struct.pitch_rate = buf.get_f32_le();
18285 __struct.yaw_rate = buf.get_f32_le();
18286 __struct.target_system = buf.get_u8();
18287 __struct.target_component = buf.get_u8();
18288 __struct.gimbal_device_id = buf.get_u8();
18289 Ok(__struct)
18290 }
18291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18292 let mut __tmp = BytesMut::new(bytes);
18293 #[allow(clippy::absurd_extreme_comparisons)]
18294 #[allow(unused_comparisons)]
18295 if __tmp.remaining() < Self::ENCODED_LEN {
18296 panic!(
18297 "buffer is too small (need {} bytes, but got {})",
18298 Self::ENCODED_LEN,
18299 __tmp.remaining(),
18300 )
18301 }
18302 __tmp.put_u32_le(self.flags.bits());
18303 __tmp.put_f32_le(self.pitch);
18304 __tmp.put_f32_le(self.yaw);
18305 __tmp.put_f32_le(self.pitch_rate);
18306 __tmp.put_f32_le(self.yaw_rate);
18307 __tmp.put_u8(self.target_system);
18308 __tmp.put_u8(self.target_component);
18309 __tmp.put_u8(self.gimbal_device_id);
18310 if matches!(version, MavlinkVersion::V2) {
18311 let len = __tmp.len();
18312 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18313 } else {
18314 __tmp.len()
18315 }
18316 }
18317}
18318#[doc = "id: 287"]
18319#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
18320#[derive(Debug, Clone, PartialEq)]
18321#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18323pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
18324 #[doc = "High level gimbal manager flags to use."]
18325 pub flags: GimbalManagerFlags,
18326 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
18327 pub pitch: f32,
18328 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
18329 pub yaw: f32,
18330 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
18331 pub pitch_rate: f32,
18332 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
18333 pub yaw_rate: f32,
18334 #[doc = "System ID"]
18335 pub target_system: u8,
18336 #[doc = "Component ID"]
18337 pub target_component: u8,
18338 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
18339 pub gimbal_device_id: u8,
18340}
18341impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
18342 pub const ENCODED_LEN: usize = 23usize;
18343 pub const DEFAULT: Self = Self {
18344 flags: GimbalManagerFlags::DEFAULT,
18345 pitch: 0.0_f32,
18346 yaw: 0.0_f32,
18347 pitch_rate: 0.0_f32,
18348 yaw_rate: 0.0_f32,
18349 target_system: 0_u8,
18350 target_component: 0_u8,
18351 gimbal_device_id: 0_u8,
18352 };
18353 #[cfg(feature = "arbitrary")]
18354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18355 use arbitrary::{Arbitrary, Unstructured};
18356 let mut buf = [0u8; 1024];
18357 rng.fill_bytes(&mut buf);
18358 let mut unstructured = Unstructured::new(&buf);
18359 Self::arbitrary(&mut unstructured).unwrap_or_default()
18360 }
18361}
18362impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
18363 fn default() -> Self {
18364 Self::DEFAULT.clone()
18365 }
18366}
18367impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
18368 type Message = MavMessage;
18369 const ID: u32 = 287u32;
18370 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
18371 const EXTRA_CRC: u8 = 1u8;
18372 const ENCODED_LEN: usize = 23usize;
18373 fn deser(
18374 _version: MavlinkVersion,
18375 __input: &[u8],
18376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18377 let avail_len = __input.len();
18378 let mut payload_buf = [0; Self::ENCODED_LEN];
18379 let mut buf = if avail_len < Self::ENCODED_LEN {
18380 payload_buf[0..avail_len].copy_from_slice(__input);
18381 Bytes::new(&payload_buf)
18382 } else {
18383 Bytes::new(__input)
18384 };
18385 let mut __struct = Self::default();
18386 let tmp = buf.get_u32_le();
18387 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18388 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18389 flag_type: "GimbalManagerFlags",
18390 value: tmp as u32,
18391 })?;
18392 __struct.pitch = buf.get_f32_le();
18393 __struct.yaw = buf.get_f32_le();
18394 __struct.pitch_rate = buf.get_f32_le();
18395 __struct.yaw_rate = buf.get_f32_le();
18396 __struct.target_system = buf.get_u8();
18397 __struct.target_component = buf.get_u8();
18398 __struct.gimbal_device_id = buf.get_u8();
18399 Ok(__struct)
18400 }
18401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18402 let mut __tmp = BytesMut::new(bytes);
18403 #[allow(clippy::absurd_extreme_comparisons)]
18404 #[allow(unused_comparisons)]
18405 if __tmp.remaining() < Self::ENCODED_LEN {
18406 panic!(
18407 "buffer is too small (need {} bytes, but got {})",
18408 Self::ENCODED_LEN,
18409 __tmp.remaining(),
18410 )
18411 }
18412 __tmp.put_u32_le(self.flags.bits());
18413 __tmp.put_f32_le(self.pitch);
18414 __tmp.put_f32_le(self.yaw);
18415 __tmp.put_f32_le(self.pitch_rate);
18416 __tmp.put_f32_le(self.yaw_rate);
18417 __tmp.put_u8(self.target_system);
18418 __tmp.put_u8(self.target_component);
18419 __tmp.put_u8(self.gimbal_device_id);
18420 if matches!(version, MavlinkVersion::V2) {
18421 let len = __tmp.len();
18422 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18423 } else {
18424 __tmp.len()
18425 }
18426 }
18427}
18428#[doc = "id: 281"]
18429#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
18430#[derive(Debug, Clone, PartialEq)]
18431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18433pub struct GIMBAL_MANAGER_STATUS_DATA {
18434 #[doc = "Timestamp (time since system boot)."]
18435 pub time_boot_ms: u32,
18436 #[doc = "High level gimbal manager flags currently applied."]
18437 pub flags: GimbalManagerFlags,
18438 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
18439 pub gimbal_device_id: u8,
18440 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
18441 pub primary_control_sysid: u8,
18442 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
18443 pub primary_control_compid: u8,
18444 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
18445 pub secondary_control_sysid: u8,
18446 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
18447 pub secondary_control_compid: u8,
18448}
18449impl GIMBAL_MANAGER_STATUS_DATA {
18450 pub const ENCODED_LEN: usize = 13usize;
18451 pub const DEFAULT: Self = Self {
18452 time_boot_ms: 0_u32,
18453 flags: GimbalManagerFlags::DEFAULT,
18454 gimbal_device_id: 0_u8,
18455 primary_control_sysid: 0_u8,
18456 primary_control_compid: 0_u8,
18457 secondary_control_sysid: 0_u8,
18458 secondary_control_compid: 0_u8,
18459 };
18460 #[cfg(feature = "arbitrary")]
18461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18462 use arbitrary::{Arbitrary, Unstructured};
18463 let mut buf = [0u8; 1024];
18464 rng.fill_bytes(&mut buf);
18465 let mut unstructured = Unstructured::new(&buf);
18466 Self::arbitrary(&mut unstructured).unwrap_or_default()
18467 }
18468}
18469impl Default for GIMBAL_MANAGER_STATUS_DATA {
18470 fn default() -> Self {
18471 Self::DEFAULT.clone()
18472 }
18473}
18474impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
18475 type Message = MavMessage;
18476 const ID: u32 = 281u32;
18477 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
18478 const EXTRA_CRC: u8 = 48u8;
18479 const ENCODED_LEN: usize = 13usize;
18480 fn deser(
18481 _version: MavlinkVersion,
18482 __input: &[u8],
18483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18484 let avail_len = __input.len();
18485 let mut payload_buf = [0; Self::ENCODED_LEN];
18486 let mut buf = if avail_len < Self::ENCODED_LEN {
18487 payload_buf[0..avail_len].copy_from_slice(__input);
18488 Bytes::new(&payload_buf)
18489 } else {
18490 Bytes::new(__input)
18491 };
18492 let mut __struct = Self::default();
18493 __struct.time_boot_ms = buf.get_u32_le();
18494 let tmp = buf.get_u32_le();
18495 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18496 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18497 flag_type: "GimbalManagerFlags",
18498 value: tmp as u32,
18499 })?;
18500 __struct.gimbal_device_id = buf.get_u8();
18501 __struct.primary_control_sysid = buf.get_u8();
18502 __struct.primary_control_compid = buf.get_u8();
18503 __struct.secondary_control_sysid = buf.get_u8();
18504 __struct.secondary_control_compid = buf.get_u8();
18505 Ok(__struct)
18506 }
18507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18508 let mut __tmp = BytesMut::new(bytes);
18509 #[allow(clippy::absurd_extreme_comparisons)]
18510 #[allow(unused_comparisons)]
18511 if __tmp.remaining() < Self::ENCODED_LEN {
18512 panic!(
18513 "buffer is too small (need {} bytes, but got {})",
18514 Self::ENCODED_LEN,
18515 __tmp.remaining(),
18516 )
18517 }
18518 __tmp.put_u32_le(self.time_boot_ms);
18519 __tmp.put_u32_le(self.flags.bits());
18520 __tmp.put_u8(self.gimbal_device_id);
18521 __tmp.put_u8(self.primary_control_sysid);
18522 __tmp.put_u8(self.primary_control_compid);
18523 __tmp.put_u8(self.secondary_control_sysid);
18524 __tmp.put_u8(self.secondary_control_compid);
18525 if matches!(version, MavlinkVersion::V2) {
18526 let len = __tmp.len();
18527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18528 } else {
18529 __tmp.len()
18530 }
18531 }
18532}
18533#[doc = "id: 200"]
18534#[doc = "3 axis gimbal measurements."]
18535#[derive(Debug, Clone, PartialEq)]
18536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18538pub struct GIMBAL_REPORT_DATA {
18539 #[doc = "Time since last update."]
18540 pub delta_time: f32,
18541 #[doc = "Delta angle X."]
18542 pub delta_angle_x: f32,
18543 #[doc = "Delta angle Y."]
18544 pub delta_angle_y: f32,
18545 #[doc = "Delta angle X."]
18546 pub delta_angle_z: f32,
18547 #[doc = "Delta velocity X."]
18548 pub delta_velocity_x: f32,
18549 #[doc = "Delta velocity Y."]
18550 pub delta_velocity_y: f32,
18551 #[doc = "Delta velocity Z."]
18552 pub delta_velocity_z: f32,
18553 #[doc = "Joint ROLL."]
18554 pub joint_roll: f32,
18555 #[doc = "Joint EL."]
18556 pub joint_el: f32,
18557 #[doc = "Joint AZ."]
18558 pub joint_az: f32,
18559 #[doc = "System ID."]
18560 pub target_system: u8,
18561 #[doc = "Component ID."]
18562 pub target_component: u8,
18563}
18564impl GIMBAL_REPORT_DATA {
18565 pub const ENCODED_LEN: usize = 42usize;
18566 pub const DEFAULT: Self = Self {
18567 delta_time: 0.0_f32,
18568 delta_angle_x: 0.0_f32,
18569 delta_angle_y: 0.0_f32,
18570 delta_angle_z: 0.0_f32,
18571 delta_velocity_x: 0.0_f32,
18572 delta_velocity_y: 0.0_f32,
18573 delta_velocity_z: 0.0_f32,
18574 joint_roll: 0.0_f32,
18575 joint_el: 0.0_f32,
18576 joint_az: 0.0_f32,
18577 target_system: 0_u8,
18578 target_component: 0_u8,
18579 };
18580 #[cfg(feature = "arbitrary")]
18581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18582 use arbitrary::{Arbitrary, Unstructured};
18583 let mut buf = [0u8; 1024];
18584 rng.fill_bytes(&mut buf);
18585 let mut unstructured = Unstructured::new(&buf);
18586 Self::arbitrary(&mut unstructured).unwrap_or_default()
18587 }
18588}
18589impl Default for GIMBAL_REPORT_DATA {
18590 fn default() -> Self {
18591 Self::DEFAULT.clone()
18592 }
18593}
18594impl MessageData for GIMBAL_REPORT_DATA {
18595 type Message = MavMessage;
18596 const ID: u32 = 200u32;
18597 const NAME: &'static str = "GIMBAL_REPORT";
18598 const EXTRA_CRC: u8 = 134u8;
18599 const ENCODED_LEN: usize = 42usize;
18600 fn deser(
18601 _version: MavlinkVersion,
18602 __input: &[u8],
18603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18604 let avail_len = __input.len();
18605 let mut payload_buf = [0; Self::ENCODED_LEN];
18606 let mut buf = if avail_len < Self::ENCODED_LEN {
18607 payload_buf[0..avail_len].copy_from_slice(__input);
18608 Bytes::new(&payload_buf)
18609 } else {
18610 Bytes::new(__input)
18611 };
18612 let mut __struct = Self::default();
18613 __struct.delta_time = buf.get_f32_le();
18614 __struct.delta_angle_x = buf.get_f32_le();
18615 __struct.delta_angle_y = buf.get_f32_le();
18616 __struct.delta_angle_z = buf.get_f32_le();
18617 __struct.delta_velocity_x = buf.get_f32_le();
18618 __struct.delta_velocity_y = buf.get_f32_le();
18619 __struct.delta_velocity_z = buf.get_f32_le();
18620 __struct.joint_roll = buf.get_f32_le();
18621 __struct.joint_el = buf.get_f32_le();
18622 __struct.joint_az = buf.get_f32_le();
18623 __struct.target_system = buf.get_u8();
18624 __struct.target_component = buf.get_u8();
18625 Ok(__struct)
18626 }
18627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18628 let mut __tmp = BytesMut::new(bytes);
18629 #[allow(clippy::absurd_extreme_comparisons)]
18630 #[allow(unused_comparisons)]
18631 if __tmp.remaining() < Self::ENCODED_LEN {
18632 panic!(
18633 "buffer is too small (need {} bytes, but got {})",
18634 Self::ENCODED_LEN,
18635 __tmp.remaining(),
18636 )
18637 }
18638 __tmp.put_f32_le(self.delta_time);
18639 __tmp.put_f32_le(self.delta_angle_x);
18640 __tmp.put_f32_le(self.delta_angle_y);
18641 __tmp.put_f32_le(self.delta_angle_z);
18642 __tmp.put_f32_le(self.delta_velocity_x);
18643 __tmp.put_f32_le(self.delta_velocity_y);
18644 __tmp.put_f32_le(self.delta_velocity_z);
18645 __tmp.put_f32_le(self.joint_roll);
18646 __tmp.put_f32_le(self.joint_el);
18647 __tmp.put_f32_le(self.joint_az);
18648 __tmp.put_u8(self.target_system);
18649 __tmp.put_u8(self.target_component);
18650 if matches!(version, MavlinkVersion::V2) {
18651 let len = __tmp.len();
18652 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18653 } else {
18654 __tmp.len()
18655 }
18656 }
18657}
18658#[doc = "id: 214"]
18659#[doc = "100 Hz gimbal torque command telemetry."]
18660#[derive(Debug, Clone, PartialEq)]
18661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18663pub struct GIMBAL_TORQUE_CMD_REPORT_DATA {
18664 #[doc = "Roll Torque Command."]
18665 pub rl_torque_cmd: i16,
18666 #[doc = "Elevation Torque Command."]
18667 pub el_torque_cmd: i16,
18668 #[doc = "Azimuth Torque Command."]
18669 pub az_torque_cmd: i16,
18670 #[doc = "System ID."]
18671 pub target_system: u8,
18672 #[doc = "Component ID."]
18673 pub target_component: u8,
18674}
18675impl GIMBAL_TORQUE_CMD_REPORT_DATA {
18676 pub const ENCODED_LEN: usize = 8usize;
18677 pub const DEFAULT: Self = Self {
18678 rl_torque_cmd: 0_i16,
18679 el_torque_cmd: 0_i16,
18680 az_torque_cmd: 0_i16,
18681 target_system: 0_u8,
18682 target_component: 0_u8,
18683 };
18684 #[cfg(feature = "arbitrary")]
18685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18686 use arbitrary::{Arbitrary, Unstructured};
18687 let mut buf = [0u8; 1024];
18688 rng.fill_bytes(&mut buf);
18689 let mut unstructured = Unstructured::new(&buf);
18690 Self::arbitrary(&mut unstructured).unwrap_or_default()
18691 }
18692}
18693impl Default for GIMBAL_TORQUE_CMD_REPORT_DATA {
18694 fn default() -> Self {
18695 Self::DEFAULT.clone()
18696 }
18697}
18698impl MessageData for GIMBAL_TORQUE_CMD_REPORT_DATA {
18699 type Message = MavMessage;
18700 const ID: u32 = 214u32;
18701 const NAME: &'static str = "GIMBAL_TORQUE_CMD_REPORT";
18702 const EXTRA_CRC: u8 = 69u8;
18703 const ENCODED_LEN: usize = 8usize;
18704 fn deser(
18705 _version: MavlinkVersion,
18706 __input: &[u8],
18707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18708 let avail_len = __input.len();
18709 let mut payload_buf = [0; Self::ENCODED_LEN];
18710 let mut buf = if avail_len < Self::ENCODED_LEN {
18711 payload_buf[0..avail_len].copy_from_slice(__input);
18712 Bytes::new(&payload_buf)
18713 } else {
18714 Bytes::new(__input)
18715 };
18716 let mut __struct = Self::default();
18717 __struct.rl_torque_cmd = buf.get_i16_le();
18718 __struct.el_torque_cmd = buf.get_i16_le();
18719 __struct.az_torque_cmd = buf.get_i16_le();
18720 __struct.target_system = buf.get_u8();
18721 __struct.target_component = buf.get_u8();
18722 Ok(__struct)
18723 }
18724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18725 let mut __tmp = BytesMut::new(bytes);
18726 #[allow(clippy::absurd_extreme_comparisons)]
18727 #[allow(unused_comparisons)]
18728 if __tmp.remaining() < Self::ENCODED_LEN {
18729 panic!(
18730 "buffer is too small (need {} bytes, but got {})",
18731 Self::ENCODED_LEN,
18732 __tmp.remaining(),
18733 )
18734 }
18735 __tmp.put_i16_le(self.rl_torque_cmd);
18736 __tmp.put_i16_le(self.el_torque_cmd);
18737 __tmp.put_i16_le(self.az_torque_cmd);
18738 __tmp.put_u8(self.target_system);
18739 __tmp.put_u8(self.target_component);
18740 if matches!(version, MavlinkVersion::V2) {
18741 let len = __tmp.len();
18742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18743 } else {
18744 __tmp.len()
18745 }
18746 }
18747}
18748#[doc = "id: 33"]
18749#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
18750#[derive(Debug, Clone, PartialEq)]
18751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18753pub struct GLOBAL_POSITION_INT_DATA {
18754 #[doc = "Timestamp (time since system boot)."]
18755 pub time_boot_ms: u32,
18756 #[doc = "Latitude, expressed"]
18757 pub lat: i32,
18758 #[doc = "Longitude, expressed"]
18759 pub lon: i32,
18760 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
18761 pub alt: i32,
18762 #[doc = "Altitude above home"]
18763 pub relative_alt: i32,
18764 #[doc = "Ground X Speed (Latitude, positive north)"]
18765 pub vx: i16,
18766 #[doc = "Ground Y Speed (Longitude, positive east)"]
18767 pub vy: i16,
18768 #[doc = "Ground Z Speed (Altitude, positive down)"]
18769 pub vz: i16,
18770 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
18771 pub hdg: u16,
18772}
18773impl GLOBAL_POSITION_INT_DATA {
18774 pub const ENCODED_LEN: usize = 28usize;
18775 pub const DEFAULT: Self = Self {
18776 time_boot_ms: 0_u32,
18777 lat: 0_i32,
18778 lon: 0_i32,
18779 alt: 0_i32,
18780 relative_alt: 0_i32,
18781 vx: 0_i16,
18782 vy: 0_i16,
18783 vz: 0_i16,
18784 hdg: 0_u16,
18785 };
18786 #[cfg(feature = "arbitrary")]
18787 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18788 use arbitrary::{Arbitrary, Unstructured};
18789 let mut buf = [0u8; 1024];
18790 rng.fill_bytes(&mut buf);
18791 let mut unstructured = Unstructured::new(&buf);
18792 Self::arbitrary(&mut unstructured).unwrap_or_default()
18793 }
18794}
18795impl Default for GLOBAL_POSITION_INT_DATA {
18796 fn default() -> Self {
18797 Self::DEFAULT.clone()
18798 }
18799}
18800impl MessageData for GLOBAL_POSITION_INT_DATA {
18801 type Message = MavMessage;
18802 const ID: u32 = 33u32;
18803 const NAME: &'static str = "GLOBAL_POSITION_INT";
18804 const EXTRA_CRC: u8 = 104u8;
18805 const ENCODED_LEN: usize = 28usize;
18806 fn deser(
18807 _version: MavlinkVersion,
18808 __input: &[u8],
18809 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18810 let avail_len = __input.len();
18811 let mut payload_buf = [0; Self::ENCODED_LEN];
18812 let mut buf = if avail_len < Self::ENCODED_LEN {
18813 payload_buf[0..avail_len].copy_from_slice(__input);
18814 Bytes::new(&payload_buf)
18815 } else {
18816 Bytes::new(__input)
18817 };
18818 let mut __struct = Self::default();
18819 __struct.time_boot_ms = buf.get_u32_le();
18820 __struct.lat = buf.get_i32_le();
18821 __struct.lon = buf.get_i32_le();
18822 __struct.alt = buf.get_i32_le();
18823 __struct.relative_alt = buf.get_i32_le();
18824 __struct.vx = buf.get_i16_le();
18825 __struct.vy = buf.get_i16_le();
18826 __struct.vz = buf.get_i16_le();
18827 __struct.hdg = buf.get_u16_le();
18828 Ok(__struct)
18829 }
18830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18831 let mut __tmp = BytesMut::new(bytes);
18832 #[allow(clippy::absurd_extreme_comparisons)]
18833 #[allow(unused_comparisons)]
18834 if __tmp.remaining() < Self::ENCODED_LEN {
18835 panic!(
18836 "buffer is too small (need {} bytes, but got {})",
18837 Self::ENCODED_LEN,
18838 __tmp.remaining(),
18839 )
18840 }
18841 __tmp.put_u32_le(self.time_boot_ms);
18842 __tmp.put_i32_le(self.lat);
18843 __tmp.put_i32_le(self.lon);
18844 __tmp.put_i32_le(self.alt);
18845 __tmp.put_i32_le(self.relative_alt);
18846 __tmp.put_i16_le(self.vx);
18847 __tmp.put_i16_le(self.vy);
18848 __tmp.put_i16_le(self.vz);
18849 __tmp.put_u16_le(self.hdg);
18850 if matches!(version, MavlinkVersion::V2) {
18851 let len = __tmp.len();
18852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18853 } else {
18854 __tmp.len()
18855 }
18856 }
18857}
18858#[doc = "id: 63"]
18859#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
18860#[derive(Debug, Clone, PartialEq)]
18861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18863pub struct GLOBAL_POSITION_INT_COV_DATA {
18864 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18865 pub time_usec: u64,
18866 #[doc = "Latitude"]
18867 pub lat: i32,
18868 #[doc = "Longitude"]
18869 pub lon: i32,
18870 #[doc = "Altitude in meters above MSL"]
18871 pub alt: i32,
18872 #[doc = "Altitude above ground"]
18873 pub relative_alt: i32,
18874 #[doc = "Ground X Speed (Latitude)"]
18875 pub vx: f32,
18876 #[doc = "Ground Y Speed (Longitude)"]
18877 pub vy: f32,
18878 #[doc = "Ground Z Speed (Altitude)"]
18879 pub vz: f32,
18880 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18881 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18882 pub covariance: [f32; 36],
18883 #[doc = "Class id of the estimator this estimate originated from."]
18884 pub estimator_type: MavEstimatorType,
18885}
18886impl GLOBAL_POSITION_INT_COV_DATA {
18887 pub const ENCODED_LEN: usize = 181usize;
18888 pub const DEFAULT: Self = Self {
18889 time_usec: 0_u64,
18890 lat: 0_i32,
18891 lon: 0_i32,
18892 alt: 0_i32,
18893 relative_alt: 0_i32,
18894 vx: 0.0_f32,
18895 vy: 0.0_f32,
18896 vz: 0.0_f32,
18897 covariance: [0.0_f32; 36usize],
18898 estimator_type: MavEstimatorType::DEFAULT,
18899 };
18900 #[cfg(feature = "arbitrary")]
18901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18902 use arbitrary::{Arbitrary, Unstructured};
18903 let mut buf = [0u8; 1024];
18904 rng.fill_bytes(&mut buf);
18905 let mut unstructured = Unstructured::new(&buf);
18906 Self::arbitrary(&mut unstructured).unwrap_or_default()
18907 }
18908}
18909impl Default for GLOBAL_POSITION_INT_COV_DATA {
18910 fn default() -> Self {
18911 Self::DEFAULT.clone()
18912 }
18913}
18914impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
18915 type Message = MavMessage;
18916 const ID: u32 = 63u32;
18917 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
18918 const EXTRA_CRC: u8 = 119u8;
18919 const ENCODED_LEN: usize = 181usize;
18920 fn deser(
18921 _version: MavlinkVersion,
18922 __input: &[u8],
18923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18924 let avail_len = __input.len();
18925 let mut payload_buf = [0; Self::ENCODED_LEN];
18926 let mut buf = if avail_len < Self::ENCODED_LEN {
18927 payload_buf[0..avail_len].copy_from_slice(__input);
18928 Bytes::new(&payload_buf)
18929 } else {
18930 Bytes::new(__input)
18931 };
18932 let mut __struct = Self::default();
18933 __struct.time_usec = buf.get_u64_le();
18934 __struct.lat = buf.get_i32_le();
18935 __struct.lon = buf.get_i32_le();
18936 __struct.alt = buf.get_i32_le();
18937 __struct.relative_alt = buf.get_i32_le();
18938 __struct.vx = buf.get_f32_le();
18939 __struct.vy = buf.get_f32_le();
18940 __struct.vz = buf.get_f32_le();
18941 for v in &mut __struct.covariance {
18942 let val = buf.get_f32_le();
18943 *v = val;
18944 }
18945 let tmp = buf.get_u8();
18946 __struct.estimator_type =
18947 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18948 enum_type: "MavEstimatorType",
18949 value: tmp as u32,
18950 })?;
18951 Ok(__struct)
18952 }
18953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18954 let mut __tmp = BytesMut::new(bytes);
18955 #[allow(clippy::absurd_extreme_comparisons)]
18956 #[allow(unused_comparisons)]
18957 if __tmp.remaining() < Self::ENCODED_LEN {
18958 panic!(
18959 "buffer is too small (need {} bytes, but got {})",
18960 Self::ENCODED_LEN,
18961 __tmp.remaining(),
18962 )
18963 }
18964 __tmp.put_u64_le(self.time_usec);
18965 __tmp.put_i32_le(self.lat);
18966 __tmp.put_i32_le(self.lon);
18967 __tmp.put_i32_le(self.alt);
18968 __tmp.put_i32_le(self.relative_alt);
18969 __tmp.put_f32_le(self.vx);
18970 __tmp.put_f32_le(self.vy);
18971 __tmp.put_f32_le(self.vz);
18972 for val in &self.covariance {
18973 __tmp.put_f32_le(*val);
18974 }
18975 __tmp.put_u8(self.estimator_type as u8);
18976 if matches!(version, MavlinkVersion::V2) {
18977 let len = __tmp.len();
18978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18979 } else {
18980 __tmp.len()
18981 }
18982 }
18983}
18984#[doc = "id: 101"]
18985#[doc = "Global position/attitude estimate from a vision source."]
18986#[derive(Debug, Clone, PartialEq)]
18987#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18989pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
18990 #[doc = "Timestamp (UNIX time or since system boot)"]
18991 pub usec: u64,
18992 #[doc = "Global X position"]
18993 pub x: f32,
18994 #[doc = "Global Y position"]
18995 pub y: f32,
18996 #[doc = "Global Z position"]
18997 pub z: f32,
18998 #[doc = "Roll angle"]
18999 pub roll: f32,
19000 #[doc = "Pitch angle"]
19001 pub pitch: f32,
19002 #[doc = "Yaw angle"]
19003 pub yaw: f32,
19004 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
19005 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19007 pub covariance: [f32; 21],
19008 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
19009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19010 pub reset_counter: u8,
19011}
19012impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
19013 pub const ENCODED_LEN: usize = 117usize;
19014 pub const DEFAULT: Self = Self {
19015 usec: 0_u64,
19016 x: 0.0_f32,
19017 y: 0.0_f32,
19018 z: 0.0_f32,
19019 roll: 0.0_f32,
19020 pitch: 0.0_f32,
19021 yaw: 0.0_f32,
19022 covariance: [0.0_f32; 21usize],
19023 reset_counter: 0_u8,
19024 };
19025 #[cfg(feature = "arbitrary")]
19026 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19027 use arbitrary::{Arbitrary, Unstructured};
19028 let mut buf = [0u8; 1024];
19029 rng.fill_bytes(&mut buf);
19030 let mut unstructured = Unstructured::new(&buf);
19031 Self::arbitrary(&mut unstructured).unwrap_or_default()
19032 }
19033}
19034impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
19035 fn default() -> Self {
19036 Self::DEFAULT.clone()
19037 }
19038}
19039impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
19040 type Message = MavMessage;
19041 const ID: u32 = 101u32;
19042 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
19043 const EXTRA_CRC: u8 = 102u8;
19044 const ENCODED_LEN: usize = 117usize;
19045 fn deser(
19046 _version: MavlinkVersion,
19047 __input: &[u8],
19048 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19049 let avail_len = __input.len();
19050 let mut payload_buf = [0; Self::ENCODED_LEN];
19051 let mut buf = if avail_len < Self::ENCODED_LEN {
19052 payload_buf[0..avail_len].copy_from_slice(__input);
19053 Bytes::new(&payload_buf)
19054 } else {
19055 Bytes::new(__input)
19056 };
19057 let mut __struct = Self::default();
19058 __struct.usec = buf.get_u64_le();
19059 __struct.x = buf.get_f32_le();
19060 __struct.y = buf.get_f32_le();
19061 __struct.z = buf.get_f32_le();
19062 __struct.roll = buf.get_f32_le();
19063 __struct.pitch = buf.get_f32_le();
19064 __struct.yaw = buf.get_f32_le();
19065 for v in &mut __struct.covariance {
19066 let val = buf.get_f32_le();
19067 *v = val;
19068 }
19069 __struct.reset_counter = buf.get_u8();
19070 Ok(__struct)
19071 }
19072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19073 let mut __tmp = BytesMut::new(bytes);
19074 #[allow(clippy::absurd_extreme_comparisons)]
19075 #[allow(unused_comparisons)]
19076 if __tmp.remaining() < Self::ENCODED_LEN {
19077 panic!(
19078 "buffer is too small (need {} bytes, but got {})",
19079 Self::ENCODED_LEN,
19080 __tmp.remaining(),
19081 )
19082 }
19083 __tmp.put_u64_le(self.usec);
19084 __tmp.put_f32_le(self.x);
19085 __tmp.put_f32_le(self.y);
19086 __tmp.put_f32_le(self.z);
19087 __tmp.put_f32_le(self.roll);
19088 __tmp.put_f32_le(self.pitch);
19089 __tmp.put_f32_le(self.yaw);
19090 for val in &self.covariance {
19091 __tmp.put_f32_le(*val);
19092 }
19093 __tmp.put_u8(self.reset_counter);
19094 if matches!(version, MavlinkVersion::V2) {
19095 let len = __tmp.len();
19096 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19097 } else {
19098 __tmp.len()
19099 }
19100 }
19101}
19102#[doc = "id: 216"]
19103#[doc = "Request a GOPRO_COMMAND response from the GoPro."]
19104#[derive(Debug, Clone, PartialEq)]
19105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19107pub struct GOPRO_GET_REQUEST_DATA {
19108 #[doc = "System ID."]
19109 pub target_system: u8,
19110 #[doc = "Component ID."]
19111 pub target_component: u8,
19112 #[doc = "Command ID."]
19113 pub cmd_id: GoproCommand,
19114}
19115impl GOPRO_GET_REQUEST_DATA {
19116 pub const ENCODED_LEN: usize = 3usize;
19117 pub const DEFAULT: Self = Self {
19118 target_system: 0_u8,
19119 target_component: 0_u8,
19120 cmd_id: GoproCommand::DEFAULT,
19121 };
19122 #[cfg(feature = "arbitrary")]
19123 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19124 use arbitrary::{Arbitrary, Unstructured};
19125 let mut buf = [0u8; 1024];
19126 rng.fill_bytes(&mut buf);
19127 let mut unstructured = Unstructured::new(&buf);
19128 Self::arbitrary(&mut unstructured).unwrap_or_default()
19129 }
19130}
19131impl Default for GOPRO_GET_REQUEST_DATA {
19132 fn default() -> Self {
19133 Self::DEFAULT.clone()
19134 }
19135}
19136impl MessageData for GOPRO_GET_REQUEST_DATA {
19137 type Message = MavMessage;
19138 const ID: u32 = 216u32;
19139 const NAME: &'static str = "GOPRO_GET_REQUEST";
19140 const EXTRA_CRC: u8 = 50u8;
19141 const ENCODED_LEN: usize = 3usize;
19142 fn deser(
19143 _version: MavlinkVersion,
19144 __input: &[u8],
19145 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19146 let avail_len = __input.len();
19147 let mut payload_buf = [0; Self::ENCODED_LEN];
19148 let mut buf = if avail_len < Self::ENCODED_LEN {
19149 payload_buf[0..avail_len].copy_from_slice(__input);
19150 Bytes::new(&payload_buf)
19151 } else {
19152 Bytes::new(__input)
19153 };
19154 let mut __struct = Self::default();
19155 __struct.target_system = buf.get_u8();
19156 __struct.target_component = buf.get_u8();
19157 let tmp = buf.get_u8();
19158 __struct.cmd_id =
19159 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19160 enum_type: "GoproCommand",
19161 value: tmp as u32,
19162 })?;
19163 Ok(__struct)
19164 }
19165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19166 let mut __tmp = BytesMut::new(bytes);
19167 #[allow(clippy::absurd_extreme_comparisons)]
19168 #[allow(unused_comparisons)]
19169 if __tmp.remaining() < Self::ENCODED_LEN {
19170 panic!(
19171 "buffer is too small (need {} bytes, but got {})",
19172 Self::ENCODED_LEN,
19173 __tmp.remaining(),
19174 )
19175 }
19176 __tmp.put_u8(self.target_system);
19177 __tmp.put_u8(self.target_component);
19178 __tmp.put_u8(self.cmd_id as u8);
19179 if matches!(version, MavlinkVersion::V2) {
19180 let len = __tmp.len();
19181 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19182 } else {
19183 __tmp.len()
19184 }
19185 }
19186}
19187#[doc = "id: 217"]
19188#[doc = "Response from a GOPRO_COMMAND get request."]
19189#[derive(Debug, Clone, PartialEq)]
19190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19192pub struct GOPRO_GET_RESPONSE_DATA {
19193 #[doc = "Command ID."]
19194 pub cmd_id: GoproCommand,
19195 #[doc = "Status."]
19196 pub status: GoproRequestStatus,
19197 #[doc = "Value."]
19198 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19199 pub value: [u8; 4],
19200}
19201impl GOPRO_GET_RESPONSE_DATA {
19202 pub const ENCODED_LEN: usize = 6usize;
19203 pub const DEFAULT: Self = Self {
19204 cmd_id: GoproCommand::DEFAULT,
19205 status: GoproRequestStatus::DEFAULT,
19206 value: [0_u8; 4usize],
19207 };
19208 #[cfg(feature = "arbitrary")]
19209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19210 use arbitrary::{Arbitrary, Unstructured};
19211 let mut buf = [0u8; 1024];
19212 rng.fill_bytes(&mut buf);
19213 let mut unstructured = Unstructured::new(&buf);
19214 Self::arbitrary(&mut unstructured).unwrap_or_default()
19215 }
19216}
19217impl Default for GOPRO_GET_RESPONSE_DATA {
19218 fn default() -> Self {
19219 Self::DEFAULT.clone()
19220 }
19221}
19222impl MessageData for GOPRO_GET_RESPONSE_DATA {
19223 type Message = MavMessage;
19224 const ID: u32 = 217u32;
19225 const NAME: &'static str = "GOPRO_GET_RESPONSE";
19226 const EXTRA_CRC: u8 = 202u8;
19227 const ENCODED_LEN: usize = 6usize;
19228 fn deser(
19229 _version: MavlinkVersion,
19230 __input: &[u8],
19231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19232 let avail_len = __input.len();
19233 let mut payload_buf = [0; Self::ENCODED_LEN];
19234 let mut buf = if avail_len < Self::ENCODED_LEN {
19235 payload_buf[0..avail_len].copy_from_slice(__input);
19236 Bytes::new(&payload_buf)
19237 } else {
19238 Bytes::new(__input)
19239 };
19240 let mut __struct = Self::default();
19241 let tmp = buf.get_u8();
19242 __struct.cmd_id =
19243 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19244 enum_type: "GoproCommand",
19245 value: tmp as u32,
19246 })?;
19247 let tmp = buf.get_u8();
19248 __struct.status =
19249 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19250 enum_type: "GoproRequestStatus",
19251 value: tmp as u32,
19252 })?;
19253 for v in &mut __struct.value {
19254 let val = buf.get_u8();
19255 *v = val;
19256 }
19257 Ok(__struct)
19258 }
19259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19260 let mut __tmp = BytesMut::new(bytes);
19261 #[allow(clippy::absurd_extreme_comparisons)]
19262 #[allow(unused_comparisons)]
19263 if __tmp.remaining() < Self::ENCODED_LEN {
19264 panic!(
19265 "buffer is too small (need {} bytes, but got {})",
19266 Self::ENCODED_LEN,
19267 __tmp.remaining(),
19268 )
19269 }
19270 __tmp.put_u8(self.cmd_id as u8);
19271 __tmp.put_u8(self.status as u8);
19272 for val in &self.value {
19273 __tmp.put_u8(*val);
19274 }
19275 if matches!(version, MavlinkVersion::V2) {
19276 let len = __tmp.len();
19277 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19278 } else {
19279 __tmp.len()
19280 }
19281 }
19282}
19283#[doc = "id: 215"]
19284#[doc = "Heartbeat from a HeroBus attached GoPro."]
19285#[derive(Debug, Clone, PartialEq)]
19286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19288pub struct GOPRO_HEARTBEAT_DATA {
19289 #[doc = "Status."]
19290 pub status: GoproHeartbeatStatus,
19291 #[doc = "Current capture mode."]
19292 pub capture_mode: GoproCaptureMode,
19293 #[doc = "Additional status bits."]
19294 pub flags: GoproHeartbeatFlags,
19295}
19296impl GOPRO_HEARTBEAT_DATA {
19297 pub const ENCODED_LEN: usize = 3usize;
19298 pub const DEFAULT: Self = Self {
19299 status: GoproHeartbeatStatus::DEFAULT,
19300 capture_mode: GoproCaptureMode::DEFAULT,
19301 flags: GoproHeartbeatFlags::DEFAULT,
19302 };
19303 #[cfg(feature = "arbitrary")]
19304 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19305 use arbitrary::{Arbitrary, Unstructured};
19306 let mut buf = [0u8; 1024];
19307 rng.fill_bytes(&mut buf);
19308 let mut unstructured = Unstructured::new(&buf);
19309 Self::arbitrary(&mut unstructured).unwrap_or_default()
19310 }
19311}
19312impl Default for GOPRO_HEARTBEAT_DATA {
19313 fn default() -> Self {
19314 Self::DEFAULT.clone()
19315 }
19316}
19317impl MessageData for GOPRO_HEARTBEAT_DATA {
19318 type Message = MavMessage;
19319 const ID: u32 = 215u32;
19320 const NAME: &'static str = "GOPRO_HEARTBEAT";
19321 const EXTRA_CRC: u8 = 101u8;
19322 const ENCODED_LEN: usize = 3usize;
19323 fn deser(
19324 _version: MavlinkVersion,
19325 __input: &[u8],
19326 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19327 let avail_len = __input.len();
19328 let mut payload_buf = [0; Self::ENCODED_LEN];
19329 let mut buf = if avail_len < Self::ENCODED_LEN {
19330 payload_buf[0..avail_len].copy_from_slice(__input);
19331 Bytes::new(&payload_buf)
19332 } else {
19333 Bytes::new(__input)
19334 };
19335 let mut __struct = Self::default();
19336 let tmp = buf.get_u8();
19337 __struct.status =
19338 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19339 enum_type: "GoproHeartbeatStatus",
19340 value: tmp as u32,
19341 })?;
19342 let tmp = buf.get_u8();
19343 __struct.capture_mode =
19344 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19345 enum_type: "GoproCaptureMode",
19346 value: tmp as u32,
19347 })?;
19348 let tmp = buf.get_u8();
19349 __struct.flags = GoproHeartbeatFlags::from_bits(tmp & GoproHeartbeatFlags::all().bits())
19350 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
19351 flag_type: "GoproHeartbeatFlags",
19352 value: tmp as u32,
19353 })?;
19354 Ok(__struct)
19355 }
19356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19357 let mut __tmp = BytesMut::new(bytes);
19358 #[allow(clippy::absurd_extreme_comparisons)]
19359 #[allow(unused_comparisons)]
19360 if __tmp.remaining() < Self::ENCODED_LEN {
19361 panic!(
19362 "buffer is too small (need {} bytes, but got {})",
19363 Self::ENCODED_LEN,
19364 __tmp.remaining(),
19365 )
19366 }
19367 __tmp.put_u8(self.status as u8);
19368 __tmp.put_u8(self.capture_mode as u8);
19369 __tmp.put_u8(self.flags.bits());
19370 if matches!(version, MavlinkVersion::V2) {
19371 let len = __tmp.len();
19372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19373 } else {
19374 __tmp.len()
19375 }
19376 }
19377}
19378#[doc = "id: 218"]
19379#[doc = "Request to set a GOPRO_COMMAND with a desired."]
19380#[derive(Debug, Clone, PartialEq)]
19381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19383pub struct GOPRO_SET_REQUEST_DATA {
19384 #[doc = "System ID."]
19385 pub target_system: u8,
19386 #[doc = "Component ID."]
19387 pub target_component: u8,
19388 #[doc = "Command ID."]
19389 pub cmd_id: GoproCommand,
19390 #[doc = "Value."]
19391 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19392 pub value: [u8; 4],
19393}
19394impl GOPRO_SET_REQUEST_DATA {
19395 pub const ENCODED_LEN: usize = 7usize;
19396 pub const DEFAULT: Self = Self {
19397 target_system: 0_u8,
19398 target_component: 0_u8,
19399 cmd_id: GoproCommand::DEFAULT,
19400 value: [0_u8; 4usize],
19401 };
19402 #[cfg(feature = "arbitrary")]
19403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19404 use arbitrary::{Arbitrary, Unstructured};
19405 let mut buf = [0u8; 1024];
19406 rng.fill_bytes(&mut buf);
19407 let mut unstructured = Unstructured::new(&buf);
19408 Self::arbitrary(&mut unstructured).unwrap_or_default()
19409 }
19410}
19411impl Default for GOPRO_SET_REQUEST_DATA {
19412 fn default() -> Self {
19413 Self::DEFAULT.clone()
19414 }
19415}
19416impl MessageData for GOPRO_SET_REQUEST_DATA {
19417 type Message = MavMessage;
19418 const ID: u32 = 218u32;
19419 const NAME: &'static str = "GOPRO_SET_REQUEST";
19420 const EXTRA_CRC: u8 = 17u8;
19421 const ENCODED_LEN: usize = 7usize;
19422 fn deser(
19423 _version: MavlinkVersion,
19424 __input: &[u8],
19425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19426 let avail_len = __input.len();
19427 let mut payload_buf = [0; Self::ENCODED_LEN];
19428 let mut buf = if avail_len < Self::ENCODED_LEN {
19429 payload_buf[0..avail_len].copy_from_slice(__input);
19430 Bytes::new(&payload_buf)
19431 } else {
19432 Bytes::new(__input)
19433 };
19434 let mut __struct = Self::default();
19435 __struct.target_system = buf.get_u8();
19436 __struct.target_component = buf.get_u8();
19437 let tmp = buf.get_u8();
19438 __struct.cmd_id =
19439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19440 enum_type: "GoproCommand",
19441 value: tmp as u32,
19442 })?;
19443 for v in &mut __struct.value {
19444 let val = buf.get_u8();
19445 *v = val;
19446 }
19447 Ok(__struct)
19448 }
19449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19450 let mut __tmp = BytesMut::new(bytes);
19451 #[allow(clippy::absurd_extreme_comparisons)]
19452 #[allow(unused_comparisons)]
19453 if __tmp.remaining() < Self::ENCODED_LEN {
19454 panic!(
19455 "buffer is too small (need {} bytes, but got {})",
19456 Self::ENCODED_LEN,
19457 __tmp.remaining(),
19458 )
19459 }
19460 __tmp.put_u8(self.target_system);
19461 __tmp.put_u8(self.target_component);
19462 __tmp.put_u8(self.cmd_id as u8);
19463 for val in &self.value {
19464 __tmp.put_u8(*val);
19465 }
19466 if matches!(version, MavlinkVersion::V2) {
19467 let len = __tmp.len();
19468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19469 } else {
19470 __tmp.len()
19471 }
19472 }
19473}
19474#[doc = "id: 219"]
19475#[doc = "Response from a GOPRO_COMMAND set request."]
19476#[derive(Debug, Clone, PartialEq)]
19477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19479pub struct GOPRO_SET_RESPONSE_DATA {
19480 #[doc = "Command ID."]
19481 pub cmd_id: GoproCommand,
19482 #[doc = "Status."]
19483 pub status: GoproRequestStatus,
19484}
19485impl GOPRO_SET_RESPONSE_DATA {
19486 pub const ENCODED_LEN: usize = 2usize;
19487 pub const DEFAULT: Self = Self {
19488 cmd_id: GoproCommand::DEFAULT,
19489 status: GoproRequestStatus::DEFAULT,
19490 };
19491 #[cfg(feature = "arbitrary")]
19492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19493 use arbitrary::{Arbitrary, Unstructured};
19494 let mut buf = [0u8; 1024];
19495 rng.fill_bytes(&mut buf);
19496 let mut unstructured = Unstructured::new(&buf);
19497 Self::arbitrary(&mut unstructured).unwrap_or_default()
19498 }
19499}
19500impl Default for GOPRO_SET_RESPONSE_DATA {
19501 fn default() -> Self {
19502 Self::DEFAULT.clone()
19503 }
19504}
19505impl MessageData for GOPRO_SET_RESPONSE_DATA {
19506 type Message = MavMessage;
19507 const ID: u32 = 219u32;
19508 const NAME: &'static str = "GOPRO_SET_RESPONSE";
19509 const EXTRA_CRC: u8 = 162u8;
19510 const ENCODED_LEN: usize = 2usize;
19511 fn deser(
19512 _version: MavlinkVersion,
19513 __input: &[u8],
19514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19515 let avail_len = __input.len();
19516 let mut payload_buf = [0; Self::ENCODED_LEN];
19517 let mut buf = if avail_len < Self::ENCODED_LEN {
19518 payload_buf[0..avail_len].copy_from_slice(__input);
19519 Bytes::new(&payload_buf)
19520 } else {
19521 Bytes::new(__input)
19522 };
19523 let mut __struct = Self::default();
19524 let tmp = buf.get_u8();
19525 __struct.cmd_id =
19526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19527 enum_type: "GoproCommand",
19528 value: tmp as u32,
19529 })?;
19530 let tmp = buf.get_u8();
19531 __struct.status =
19532 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19533 enum_type: "GoproRequestStatus",
19534 value: tmp as u32,
19535 })?;
19536 Ok(__struct)
19537 }
19538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19539 let mut __tmp = BytesMut::new(bytes);
19540 #[allow(clippy::absurd_extreme_comparisons)]
19541 #[allow(unused_comparisons)]
19542 if __tmp.remaining() < Self::ENCODED_LEN {
19543 panic!(
19544 "buffer is too small (need {} bytes, but got {})",
19545 Self::ENCODED_LEN,
19546 __tmp.remaining(),
19547 )
19548 }
19549 __tmp.put_u8(self.cmd_id as u8);
19550 __tmp.put_u8(self.status as u8);
19551 if matches!(version, MavlinkVersion::V2) {
19552 let len = __tmp.len();
19553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19554 } else {
19555 __tmp.len()
19556 }
19557 }
19558}
19559#[doc = "id: 124"]
19560#[doc = "Second GPS data."]
19561#[derive(Debug, Clone, PartialEq)]
19562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19564pub struct GPS2_RAW_DATA {
19565 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19566 pub time_usec: u64,
19567 #[doc = "Latitude (WGS84)"]
19568 pub lat: i32,
19569 #[doc = "Longitude (WGS84)"]
19570 pub lon: i32,
19571 #[doc = "Altitude (MSL). Positive for up."]
19572 pub alt: i32,
19573 #[doc = "Age of DGPS info"]
19574 pub dgps_age: u32,
19575 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
19576 pub eph: u16,
19577 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
19578 pub epv: u16,
19579 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
19580 pub vel: u16,
19581 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
19582 pub cog: u16,
19583 #[doc = "GPS fix type."]
19584 pub fix_type: GpsFixType,
19585 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
19586 pub satellites_visible: u8,
19587 #[doc = "Number of DGPS satellites"]
19588 pub dgps_numch: u8,
19589 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
19590 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19591 pub yaw: u16,
19592 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
19593 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19594 pub alt_ellipsoid: i32,
19595 #[doc = "Position uncertainty."]
19596 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19597 pub h_acc: u32,
19598 #[doc = "Altitude uncertainty."]
19599 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19600 pub v_acc: u32,
19601 #[doc = "Speed uncertainty."]
19602 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19603 pub vel_acc: u32,
19604 #[doc = "Heading / track uncertainty"]
19605 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19606 pub hdg_acc: u32,
19607}
19608impl GPS2_RAW_DATA {
19609 pub const ENCODED_LEN: usize = 57usize;
19610 pub const DEFAULT: Self = Self {
19611 time_usec: 0_u64,
19612 lat: 0_i32,
19613 lon: 0_i32,
19614 alt: 0_i32,
19615 dgps_age: 0_u32,
19616 eph: 0_u16,
19617 epv: 0_u16,
19618 vel: 0_u16,
19619 cog: 0_u16,
19620 fix_type: GpsFixType::DEFAULT,
19621 satellites_visible: 0_u8,
19622 dgps_numch: 0_u8,
19623 yaw: 0_u16,
19624 alt_ellipsoid: 0_i32,
19625 h_acc: 0_u32,
19626 v_acc: 0_u32,
19627 vel_acc: 0_u32,
19628 hdg_acc: 0_u32,
19629 };
19630 #[cfg(feature = "arbitrary")]
19631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19632 use arbitrary::{Arbitrary, Unstructured};
19633 let mut buf = [0u8; 1024];
19634 rng.fill_bytes(&mut buf);
19635 let mut unstructured = Unstructured::new(&buf);
19636 Self::arbitrary(&mut unstructured).unwrap_or_default()
19637 }
19638}
19639impl Default for GPS2_RAW_DATA {
19640 fn default() -> Self {
19641 Self::DEFAULT.clone()
19642 }
19643}
19644impl MessageData for GPS2_RAW_DATA {
19645 type Message = MavMessage;
19646 const ID: u32 = 124u32;
19647 const NAME: &'static str = "GPS2_RAW";
19648 const EXTRA_CRC: u8 = 87u8;
19649 const ENCODED_LEN: usize = 57usize;
19650 fn deser(
19651 _version: MavlinkVersion,
19652 __input: &[u8],
19653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19654 let avail_len = __input.len();
19655 let mut payload_buf = [0; Self::ENCODED_LEN];
19656 let mut buf = if avail_len < Self::ENCODED_LEN {
19657 payload_buf[0..avail_len].copy_from_slice(__input);
19658 Bytes::new(&payload_buf)
19659 } else {
19660 Bytes::new(__input)
19661 };
19662 let mut __struct = Self::default();
19663 __struct.time_usec = buf.get_u64_le();
19664 __struct.lat = buf.get_i32_le();
19665 __struct.lon = buf.get_i32_le();
19666 __struct.alt = buf.get_i32_le();
19667 __struct.dgps_age = buf.get_u32_le();
19668 __struct.eph = buf.get_u16_le();
19669 __struct.epv = buf.get_u16_le();
19670 __struct.vel = buf.get_u16_le();
19671 __struct.cog = buf.get_u16_le();
19672 let tmp = buf.get_u8();
19673 __struct.fix_type =
19674 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19675 enum_type: "GpsFixType",
19676 value: tmp as u32,
19677 })?;
19678 __struct.satellites_visible = buf.get_u8();
19679 __struct.dgps_numch = buf.get_u8();
19680 __struct.yaw = buf.get_u16_le();
19681 __struct.alt_ellipsoid = buf.get_i32_le();
19682 __struct.h_acc = buf.get_u32_le();
19683 __struct.v_acc = buf.get_u32_le();
19684 __struct.vel_acc = buf.get_u32_le();
19685 __struct.hdg_acc = buf.get_u32_le();
19686 Ok(__struct)
19687 }
19688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19689 let mut __tmp = BytesMut::new(bytes);
19690 #[allow(clippy::absurd_extreme_comparisons)]
19691 #[allow(unused_comparisons)]
19692 if __tmp.remaining() < Self::ENCODED_LEN {
19693 panic!(
19694 "buffer is too small (need {} bytes, but got {})",
19695 Self::ENCODED_LEN,
19696 __tmp.remaining(),
19697 )
19698 }
19699 __tmp.put_u64_le(self.time_usec);
19700 __tmp.put_i32_le(self.lat);
19701 __tmp.put_i32_le(self.lon);
19702 __tmp.put_i32_le(self.alt);
19703 __tmp.put_u32_le(self.dgps_age);
19704 __tmp.put_u16_le(self.eph);
19705 __tmp.put_u16_le(self.epv);
19706 __tmp.put_u16_le(self.vel);
19707 __tmp.put_u16_le(self.cog);
19708 __tmp.put_u8(self.fix_type as u8);
19709 __tmp.put_u8(self.satellites_visible);
19710 __tmp.put_u8(self.dgps_numch);
19711 __tmp.put_u16_le(self.yaw);
19712 __tmp.put_i32_le(self.alt_ellipsoid);
19713 __tmp.put_u32_le(self.h_acc);
19714 __tmp.put_u32_le(self.v_acc);
19715 __tmp.put_u32_le(self.vel_acc);
19716 __tmp.put_u32_le(self.hdg_acc);
19717 if matches!(version, MavlinkVersion::V2) {
19718 let len = __tmp.len();
19719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19720 } else {
19721 __tmp.len()
19722 }
19723 }
19724}
19725#[doc = "id: 128"]
19726#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
19727#[derive(Debug, Clone, PartialEq)]
19728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19730pub struct GPS2_RTK_DATA {
19731 #[doc = "Time since boot of last baseline message received."]
19732 pub time_last_baseline_ms: u32,
19733 #[doc = "GPS Time of Week of last baseline"]
19734 pub tow: u32,
19735 #[doc = "Current baseline in ECEF x or NED north component."]
19736 pub baseline_a_mm: i32,
19737 #[doc = "Current baseline in ECEF y or NED east component."]
19738 pub baseline_b_mm: i32,
19739 #[doc = "Current baseline in ECEF z or NED down component."]
19740 pub baseline_c_mm: i32,
19741 #[doc = "Current estimate of baseline accuracy."]
19742 pub accuracy: u32,
19743 #[doc = "Current number of integer ambiguity hypotheses."]
19744 pub iar_num_hypotheses: i32,
19745 #[doc = "GPS Week Number of last baseline"]
19746 pub wn: u16,
19747 #[doc = "Identification of connected RTK receiver."]
19748 pub rtk_receiver_id: u8,
19749 #[doc = "GPS-specific health report for RTK data."]
19750 pub rtk_health: u8,
19751 #[doc = "Rate of baseline messages being received by GPS"]
19752 pub rtk_rate: u8,
19753 #[doc = "Current number of sats used for RTK calculation."]
19754 pub nsats: u8,
19755 #[doc = "Coordinate system of baseline"]
19756 pub baseline_coords_type: RtkBaselineCoordinateSystem,
19757}
19758impl GPS2_RTK_DATA {
19759 pub const ENCODED_LEN: usize = 35usize;
19760 pub const DEFAULT: Self = Self {
19761 time_last_baseline_ms: 0_u32,
19762 tow: 0_u32,
19763 baseline_a_mm: 0_i32,
19764 baseline_b_mm: 0_i32,
19765 baseline_c_mm: 0_i32,
19766 accuracy: 0_u32,
19767 iar_num_hypotheses: 0_i32,
19768 wn: 0_u16,
19769 rtk_receiver_id: 0_u8,
19770 rtk_health: 0_u8,
19771 rtk_rate: 0_u8,
19772 nsats: 0_u8,
19773 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
19774 };
19775 #[cfg(feature = "arbitrary")]
19776 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19777 use arbitrary::{Arbitrary, Unstructured};
19778 let mut buf = [0u8; 1024];
19779 rng.fill_bytes(&mut buf);
19780 let mut unstructured = Unstructured::new(&buf);
19781 Self::arbitrary(&mut unstructured).unwrap_or_default()
19782 }
19783}
19784impl Default for GPS2_RTK_DATA {
19785 fn default() -> Self {
19786 Self::DEFAULT.clone()
19787 }
19788}
19789impl MessageData for GPS2_RTK_DATA {
19790 type Message = MavMessage;
19791 const ID: u32 = 128u32;
19792 const NAME: &'static str = "GPS2_RTK";
19793 const EXTRA_CRC: u8 = 226u8;
19794 const ENCODED_LEN: usize = 35usize;
19795 fn deser(
19796 _version: MavlinkVersion,
19797 __input: &[u8],
19798 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19799 let avail_len = __input.len();
19800 let mut payload_buf = [0; Self::ENCODED_LEN];
19801 let mut buf = if avail_len < Self::ENCODED_LEN {
19802 payload_buf[0..avail_len].copy_from_slice(__input);
19803 Bytes::new(&payload_buf)
19804 } else {
19805 Bytes::new(__input)
19806 };
19807 let mut __struct = Self::default();
19808 __struct.time_last_baseline_ms = buf.get_u32_le();
19809 __struct.tow = buf.get_u32_le();
19810 __struct.baseline_a_mm = buf.get_i32_le();
19811 __struct.baseline_b_mm = buf.get_i32_le();
19812 __struct.baseline_c_mm = buf.get_i32_le();
19813 __struct.accuracy = buf.get_u32_le();
19814 __struct.iar_num_hypotheses = buf.get_i32_le();
19815 __struct.wn = buf.get_u16_le();
19816 __struct.rtk_receiver_id = buf.get_u8();
19817 __struct.rtk_health = buf.get_u8();
19818 __struct.rtk_rate = buf.get_u8();
19819 __struct.nsats = buf.get_u8();
19820 let tmp = buf.get_u8();
19821 __struct.baseline_coords_type =
19822 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19823 enum_type: "RtkBaselineCoordinateSystem",
19824 value: tmp as u32,
19825 })?;
19826 Ok(__struct)
19827 }
19828 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19829 let mut __tmp = BytesMut::new(bytes);
19830 #[allow(clippy::absurd_extreme_comparisons)]
19831 #[allow(unused_comparisons)]
19832 if __tmp.remaining() < Self::ENCODED_LEN {
19833 panic!(
19834 "buffer is too small (need {} bytes, but got {})",
19835 Self::ENCODED_LEN,
19836 __tmp.remaining(),
19837 )
19838 }
19839 __tmp.put_u32_le(self.time_last_baseline_ms);
19840 __tmp.put_u32_le(self.tow);
19841 __tmp.put_i32_le(self.baseline_a_mm);
19842 __tmp.put_i32_le(self.baseline_b_mm);
19843 __tmp.put_i32_le(self.baseline_c_mm);
19844 __tmp.put_u32_le(self.accuracy);
19845 __tmp.put_i32_le(self.iar_num_hypotheses);
19846 __tmp.put_u16_le(self.wn);
19847 __tmp.put_u8(self.rtk_receiver_id);
19848 __tmp.put_u8(self.rtk_health);
19849 __tmp.put_u8(self.rtk_rate);
19850 __tmp.put_u8(self.nsats);
19851 __tmp.put_u8(self.baseline_coords_type as u8);
19852 if matches!(version, MavlinkVersion::V2) {
19853 let len = __tmp.len();
19854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19855 } else {
19856 __tmp.len()
19857 }
19858 }
19859}
19860#[doc = "id: 49"]
19861#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
19862#[derive(Debug, Clone, PartialEq)]
19863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19865pub struct GPS_GLOBAL_ORIGIN_DATA {
19866 #[doc = "Latitude (WGS84)"]
19867 pub latitude: i32,
19868 #[doc = "Longitude (WGS84)"]
19869 pub longitude: i32,
19870 #[doc = "Altitude (MSL). Positive for up."]
19871 pub altitude: i32,
19872 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19874 pub time_usec: u64,
19875}
19876impl GPS_GLOBAL_ORIGIN_DATA {
19877 pub const ENCODED_LEN: usize = 20usize;
19878 pub const DEFAULT: Self = Self {
19879 latitude: 0_i32,
19880 longitude: 0_i32,
19881 altitude: 0_i32,
19882 time_usec: 0_u64,
19883 };
19884 #[cfg(feature = "arbitrary")]
19885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19886 use arbitrary::{Arbitrary, Unstructured};
19887 let mut buf = [0u8; 1024];
19888 rng.fill_bytes(&mut buf);
19889 let mut unstructured = Unstructured::new(&buf);
19890 Self::arbitrary(&mut unstructured).unwrap_or_default()
19891 }
19892}
19893impl Default for GPS_GLOBAL_ORIGIN_DATA {
19894 fn default() -> Self {
19895 Self::DEFAULT.clone()
19896 }
19897}
19898impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
19899 type Message = MavMessage;
19900 const ID: u32 = 49u32;
19901 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
19902 const EXTRA_CRC: u8 = 39u8;
19903 const ENCODED_LEN: usize = 20usize;
19904 fn deser(
19905 _version: MavlinkVersion,
19906 __input: &[u8],
19907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19908 let avail_len = __input.len();
19909 let mut payload_buf = [0; Self::ENCODED_LEN];
19910 let mut buf = if avail_len < Self::ENCODED_LEN {
19911 payload_buf[0..avail_len].copy_from_slice(__input);
19912 Bytes::new(&payload_buf)
19913 } else {
19914 Bytes::new(__input)
19915 };
19916 let mut __struct = Self::default();
19917 __struct.latitude = buf.get_i32_le();
19918 __struct.longitude = buf.get_i32_le();
19919 __struct.altitude = buf.get_i32_le();
19920 __struct.time_usec = buf.get_u64_le();
19921 Ok(__struct)
19922 }
19923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19924 let mut __tmp = BytesMut::new(bytes);
19925 #[allow(clippy::absurd_extreme_comparisons)]
19926 #[allow(unused_comparisons)]
19927 if __tmp.remaining() < Self::ENCODED_LEN {
19928 panic!(
19929 "buffer is too small (need {} bytes, but got {})",
19930 Self::ENCODED_LEN,
19931 __tmp.remaining(),
19932 )
19933 }
19934 __tmp.put_i32_le(self.latitude);
19935 __tmp.put_i32_le(self.longitude);
19936 __tmp.put_i32_le(self.altitude);
19937 __tmp.put_u64_le(self.time_usec);
19938 if matches!(version, MavlinkVersion::V2) {
19939 let len = __tmp.len();
19940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19941 } else {
19942 __tmp.len()
19943 }
19944 }
19945}
19946#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
19947#[doc = "id: 123"]
19948#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
19949#[derive(Debug, Clone, PartialEq)]
19950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19952pub struct GPS_INJECT_DATA_DATA {
19953 #[doc = "System ID"]
19954 pub target_system: u8,
19955 #[doc = "Component ID"]
19956 pub target_component: u8,
19957 #[doc = "Data length"]
19958 pub len: u8,
19959 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
19960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19961 pub data: [u8; 110],
19962}
19963impl GPS_INJECT_DATA_DATA {
19964 pub const ENCODED_LEN: usize = 113usize;
19965 pub const DEFAULT: Self = Self {
19966 target_system: 0_u8,
19967 target_component: 0_u8,
19968 len: 0_u8,
19969 data: [0_u8; 110usize],
19970 };
19971 #[cfg(feature = "arbitrary")]
19972 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19973 use arbitrary::{Arbitrary, Unstructured};
19974 let mut buf = [0u8; 1024];
19975 rng.fill_bytes(&mut buf);
19976 let mut unstructured = Unstructured::new(&buf);
19977 Self::arbitrary(&mut unstructured).unwrap_or_default()
19978 }
19979}
19980impl Default for GPS_INJECT_DATA_DATA {
19981 fn default() -> Self {
19982 Self::DEFAULT.clone()
19983 }
19984}
19985impl MessageData for GPS_INJECT_DATA_DATA {
19986 type Message = MavMessage;
19987 const ID: u32 = 123u32;
19988 const NAME: &'static str = "GPS_INJECT_DATA";
19989 const EXTRA_CRC: u8 = 250u8;
19990 const ENCODED_LEN: usize = 113usize;
19991 fn deser(
19992 _version: MavlinkVersion,
19993 __input: &[u8],
19994 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19995 let avail_len = __input.len();
19996 let mut payload_buf = [0; Self::ENCODED_LEN];
19997 let mut buf = if avail_len < Self::ENCODED_LEN {
19998 payload_buf[0..avail_len].copy_from_slice(__input);
19999 Bytes::new(&payload_buf)
20000 } else {
20001 Bytes::new(__input)
20002 };
20003 let mut __struct = Self::default();
20004 __struct.target_system = buf.get_u8();
20005 __struct.target_component = buf.get_u8();
20006 __struct.len = buf.get_u8();
20007 for v in &mut __struct.data {
20008 let val = buf.get_u8();
20009 *v = val;
20010 }
20011 Ok(__struct)
20012 }
20013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20014 let mut __tmp = BytesMut::new(bytes);
20015 #[allow(clippy::absurd_extreme_comparisons)]
20016 #[allow(unused_comparisons)]
20017 if __tmp.remaining() < Self::ENCODED_LEN {
20018 panic!(
20019 "buffer is too small (need {} bytes, but got {})",
20020 Self::ENCODED_LEN,
20021 __tmp.remaining(),
20022 )
20023 }
20024 __tmp.put_u8(self.target_system);
20025 __tmp.put_u8(self.target_component);
20026 __tmp.put_u8(self.len);
20027 for val in &self.data {
20028 __tmp.put_u8(*val);
20029 }
20030 if matches!(version, MavlinkVersion::V2) {
20031 let len = __tmp.len();
20032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20033 } else {
20034 __tmp.len()
20035 }
20036 }
20037}
20038#[doc = "id: 232"]
20039#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
20040#[derive(Debug, Clone, PartialEq)]
20041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20043pub struct GPS_INPUT_DATA {
20044 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20045 pub time_usec: u64,
20046 #[doc = "GPS time (from start of GPS week)"]
20047 pub time_week_ms: u32,
20048 #[doc = "Latitude (WGS84)"]
20049 pub lat: i32,
20050 #[doc = "Longitude (WGS84)"]
20051 pub lon: i32,
20052 #[doc = "Altitude (MSL). Positive for up."]
20053 pub alt: f32,
20054 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
20055 pub hdop: f32,
20056 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
20057 pub vdop: f32,
20058 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
20059 pub vn: f32,
20060 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
20061 pub ve: f32,
20062 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
20063 pub vd: f32,
20064 #[doc = "GPS speed accuracy"]
20065 pub speed_accuracy: f32,
20066 #[doc = "GPS horizontal accuracy"]
20067 pub horiz_accuracy: f32,
20068 #[doc = "GPS vertical accuracy"]
20069 pub vert_accuracy: f32,
20070 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
20071 pub ignore_flags: GpsInputIgnoreFlags,
20072 #[doc = "GPS week number"]
20073 pub time_week: u16,
20074 #[doc = "ID of the GPS for multiple GPS inputs"]
20075 pub gps_id: u8,
20076 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
20077 pub fix_type: u8,
20078 #[doc = "Number of satellites visible."]
20079 pub satellites_visible: u8,
20080 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
20081 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20082 pub yaw: u16,
20083}
20084impl GPS_INPUT_DATA {
20085 pub const ENCODED_LEN: usize = 65usize;
20086 pub const DEFAULT: Self = Self {
20087 time_usec: 0_u64,
20088 time_week_ms: 0_u32,
20089 lat: 0_i32,
20090 lon: 0_i32,
20091 alt: 0.0_f32,
20092 hdop: 0.0_f32,
20093 vdop: 0.0_f32,
20094 vn: 0.0_f32,
20095 ve: 0.0_f32,
20096 vd: 0.0_f32,
20097 speed_accuracy: 0.0_f32,
20098 horiz_accuracy: 0.0_f32,
20099 vert_accuracy: 0.0_f32,
20100 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
20101 time_week: 0_u16,
20102 gps_id: 0_u8,
20103 fix_type: 0_u8,
20104 satellites_visible: 0_u8,
20105 yaw: 0_u16,
20106 };
20107 #[cfg(feature = "arbitrary")]
20108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20109 use arbitrary::{Arbitrary, Unstructured};
20110 let mut buf = [0u8; 1024];
20111 rng.fill_bytes(&mut buf);
20112 let mut unstructured = Unstructured::new(&buf);
20113 Self::arbitrary(&mut unstructured).unwrap_or_default()
20114 }
20115}
20116impl Default for GPS_INPUT_DATA {
20117 fn default() -> Self {
20118 Self::DEFAULT.clone()
20119 }
20120}
20121impl MessageData for GPS_INPUT_DATA {
20122 type Message = MavMessage;
20123 const ID: u32 = 232u32;
20124 const NAME: &'static str = "GPS_INPUT";
20125 const EXTRA_CRC: u8 = 151u8;
20126 const ENCODED_LEN: usize = 65usize;
20127 fn deser(
20128 _version: MavlinkVersion,
20129 __input: &[u8],
20130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20131 let avail_len = __input.len();
20132 let mut payload_buf = [0; Self::ENCODED_LEN];
20133 let mut buf = if avail_len < Self::ENCODED_LEN {
20134 payload_buf[0..avail_len].copy_from_slice(__input);
20135 Bytes::new(&payload_buf)
20136 } else {
20137 Bytes::new(__input)
20138 };
20139 let mut __struct = Self::default();
20140 __struct.time_usec = buf.get_u64_le();
20141 __struct.time_week_ms = buf.get_u32_le();
20142 __struct.lat = buf.get_i32_le();
20143 __struct.lon = buf.get_i32_le();
20144 __struct.alt = buf.get_f32_le();
20145 __struct.hdop = buf.get_f32_le();
20146 __struct.vdop = buf.get_f32_le();
20147 __struct.vn = buf.get_f32_le();
20148 __struct.ve = buf.get_f32_le();
20149 __struct.vd = buf.get_f32_le();
20150 __struct.speed_accuracy = buf.get_f32_le();
20151 __struct.horiz_accuracy = buf.get_f32_le();
20152 __struct.vert_accuracy = buf.get_f32_le();
20153 let tmp = buf.get_u16_le();
20154 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
20155 tmp & GpsInputIgnoreFlags::all().bits(),
20156 )
20157 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
20158 flag_type: "GpsInputIgnoreFlags",
20159 value: tmp as u32,
20160 })?;
20161 __struct.time_week = buf.get_u16_le();
20162 __struct.gps_id = buf.get_u8();
20163 __struct.fix_type = buf.get_u8();
20164 __struct.satellites_visible = buf.get_u8();
20165 __struct.yaw = buf.get_u16_le();
20166 Ok(__struct)
20167 }
20168 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20169 let mut __tmp = BytesMut::new(bytes);
20170 #[allow(clippy::absurd_extreme_comparisons)]
20171 #[allow(unused_comparisons)]
20172 if __tmp.remaining() < Self::ENCODED_LEN {
20173 panic!(
20174 "buffer is too small (need {} bytes, but got {})",
20175 Self::ENCODED_LEN,
20176 __tmp.remaining(),
20177 )
20178 }
20179 __tmp.put_u64_le(self.time_usec);
20180 __tmp.put_u32_le(self.time_week_ms);
20181 __tmp.put_i32_le(self.lat);
20182 __tmp.put_i32_le(self.lon);
20183 __tmp.put_f32_le(self.alt);
20184 __tmp.put_f32_le(self.hdop);
20185 __tmp.put_f32_le(self.vdop);
20186 __tmp.put_f32_le(self.vn);
20187 __tmp.put_f32_le(self.ve);
20188 __tmp.put_f32_le(self.vd);
20189 __tmp.put_f32_le(self.speed_accuracy);
20190 __tmp.put_f32_le(self.horiz_accuracy);
20191 __tmp.put_f32_le(self.vert_accuracy);
20192 __tmp.put_u16_le(self.ignore_flags.bits());
20193 __tmp.put_u16_le(self.time_week);
20194 __tmp.put_u8(self.gps_id);
20195 __tmp.put_u8(self.fix_type);
20196 __tmp.put_u8(self.satellites_visible);
20197 __tmp.put_u16_le(self.yaw);
20198 if matches!(version, MavlinkVersion::V2) {
20199 let len = __tmp.len();
20200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20201 } else {
20202 __tmp.len()
20203 }
20204 }
20205}
20206#[doc = "id: 24"]
20207#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
20208#[derive(Debug, Clone, PartialEq)]
20209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20211pub struct GPS_RAW_INT_DATA {
20212 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20213 pub time_usec: u64,
20214 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
20215 pub lat: i32,
20216 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
20217 pub lon: i32,
20218 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
20219 pub alt: i32,
20220 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
20221 pub eph: u16,
20222 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
20223 pub epv: u16,
20224 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
20225 pub vel: u16,
20226 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
20227 pub cog: u16,
20228 #[doc = "GPS fix type."]
20229 pub fix_type: GpsFixType,
20230 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
20231 pub satellites_visible: u8,
20232 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
20233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20234 pub alt_ellipsoid: i32,
20235 #[doc = "Position uncertainty."]
20236 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20237 pub h_acc: u32,
20238 #[doc = "Altitude uncertainty."]
20239 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20240 pub v_acc: u32,
20241 #[doc = "Speed uncertainty."]
20242 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20243 pub vel_acc: u32,
20244 #[doc = "Heading / track uncertainty"]
20245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20246 pub hdg_acc: u32,
20247 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
20248 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20249 pub yaw: u16,
20250}
20251impl GPS_RAW_INT_DATA {
20252 pub const ENCODED_LEN: usize = 52usize;
20253 pub const DEFAULT: Self = Self {
20254 time_usec: 0_u64,
20255 lat: 0_i32,
20256 lon: 0_i32,
20257 alt: 0_i32,
20258 eph: 0_u16,
20259 epv: 0_u16,
20260 vel: 0_u16,
20261 cog: 0_u16,
20262 fix_type: GpsFixType::DEFAULT,
20263 satellites_visible: 0_u8,
20264 alt_ellipsoid: 0_i32,
20265 h_acc: 0_u32,
20266 v_acc: 0_u32,
20267 vel_acc: 0_u32,
20268 hdg_acc: 0_u32,
20269 yaw: 0_u16,
20270 };
20271 #[cfg(feature = "arbitrary")]
20272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20273 use arbitrary::{Arbitrary, Unstructured};
20274 let mut buf = [0u8; 1024];
20275 rng.fill_bytes(&mut buf);
20276 let mut unstructured = Unstructured::new(&buf);
20277 Self::arbitrary(&mut unstructured).unwrap_or_default()
20278 }
20279}
20280impl Default for GPS_RAW_INT_DATA {
20281 fn default() -> Self {
20282 Self::DEFAULT.clone()
20283 }
20284}
20285impl MessageData for GPS_RAW_INT_DATA {
20286 type Message = MavMessage;
20287 const ID: u32 = 24u32;
20288 const NAME: &'static str = "GPS_RAW_INT";
20289 const EXTRA_CRC: u8 = 24u8;
20290 const ENCODED_LEN: usize = 52usize;
20291 fn deser(
20292 _version: MavlinkVersion,
20293 __input: &[u8],
20294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20295 let avail_len = __input.len();
20296 let mut payload_buf = [0; Self::ENCODED_LEN];
20297 let mut buf = if avail_len < Self::ENCODED_LEN {
20298 payload_buf[0..avail_len].copy_from_slice(__input);
20299 Bytes::new(&payload_buf)
20300 } else {
20301 Bytes::new(__input)
20302 };
20303 let mut __struct = Self::default();
20304 __struct.time_usec = buf.get_u64_le();
20305 __struct.lat = buf.get_i32_le();
20306 __struct.lon = buf.get_i32_le();
20307 __struct.alt = buf.get_i32_le();
20308 __struct.eph = buf.get_u16_le();
20309 __struct.epv = buf.get_u16_le();
20310 __struct.vel = buf.get_u16_le();
20311 __struct.cog = buf.get_u16_le();
20312 let tmp = buf.get_u8();
20313 __struct.fix_type =
20314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20315 enum_type: "GpsFixType",
20316 value: tmp as u32,
20317 })?;
20318 __struct.satellites_visible = buf.get_u8();
20319 __struct.alt_ellipsoid = buf.get_i32_le();
20320 __struct.h_acc = buf.get_u32_le();
20321 __struct.v_acc = buf.get_u32_le();
20322 __struct.vel_acc = buf.get_u32_le();
20323 __struct.hdg_acc = buf.get_u32_le();
20324 __struct.yaw = buf.get_u16_le();
20325 Ok(__struct)
20326 }
20327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20328 let mut __tmp = BytesMut::new(bytes);
20329 #[allow(clippy::absurd_extreme_comparisons)]
20330 #[allow(unused_comparisons)]
20331 if __tmp.remaining() < Self::ENCODED_LEN {
20332 panic!(
20333 "buffer is too small (need {} bytes, but got {})",
20334 Self::ENCODED_LEN,
20335 __tmp.remaining(),
20336 )
20337 }
20338 __tmp.put_u64_le(self.time_usec);
20339 __tmp.put_i32_le(self.lat);
20340 __tmp.put_i32_le(self.lon);
20341 __tmp.put_i32_le(self.alt);
20342 __tmp.put_u16_le(self.eph);
20343 __tmp.put_u16_le(self.epv);
20344 __tmp.put_u16_le(self.vel);
20345 __tmp.put_u16_le(self.cog);
20346 __tmp.put_u8(self.fix_type as u8);
20347 __tmp.put_u8(self.satellites_visible);
20348 __tmp.put_i32_le(self.alt_ellipsoid);
20349 __tmp.put_u32_le(self.h_acc);
20350 __tmp.put_u32_le(self.v_acc);
20351 __tmp.put_u32_le(self.vel_acc);
20352 __tmp.put_u32_le(self.hdg_acc);
20353 __tmp.put_u16_le(self.yaw);
20354 if matches!(version, MavlinkVersion::V2) {
20355 let len = __tmp.len();
20356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20357 } else {
20358 __tmp.len()
20359 }
20360 }
20361}
20362#[doc = "id: 233"]
20363#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
20364#[derive(Debug, Clone, PartialEq)]
20365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20367pub struct GPS_RTCM_DATA_DATA {
20368 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
20369 pub flags: u8,
20370 #[doc = "data length"]
20371 pub len: u8,
20372 #[doc = "RTCM message (may be fragmented)"]
20373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20374 pub data: [u8; 180],
20375}
20376impl GPS_RTCM_DATA_DATA {
20377 pub const ENCODED_LEN: usize = 182usize;
20378 pub const DEFAULT: Self = Self {
20379 flags: 0_u8,
20380 len: 0_u8,
20381 data: [0_u8; 180usize],
20382 };
20383 #[cfg(feature = "arbitrary")]
20384 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20385 use arbitrary::{Arbitrary, Unstructured};
20386 let mut buf = [0u8; 1024];
20387 rng.fill_bytes(&mut buf);
20388 let mut unstructured = Unstructured::new(&buf);
20389 Self::arbitrary(&mut unstructured).unwrap_or_default()
20390 }
20391}
20392impl Default for GPS_RTCM_DATA_DATA {
20393 fn default() -> Self {
20394 Self::DEFAULT.clone()
20395 }
20396}
20397impl MessageData for GPS_RTCM_DATA_DATA {
20398 type Message = MavMessage;
20399 const ID: u32 = 233u32;
20400 const NAME: &'static str = "GPS_RTCM_DATA";
20401 const EXTRA_CRC: u8 = 35u8;
20402 const ENCODED_LEN: usize = 182usize;
20403 fn deser(
20404 _version: MavlinkVersion,
20405 __input: &[u8],
20406 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20407 let avail_len = __input.len();
20408 let mut payload_buf = [0; Self::ENCODED_LEN];
20409 let mut buf = if avail_len < Self::ENCODED_LEN {
20410 payload_buf[0..avail_len].copy_from_slice(__input);
20411 Bytes::new(&payload_buf)
20412 } else {
20413 Bytes::new(__input)
20414 };
20415 let mut __struct = Self::default();
20416 __struct.flags = buf.get_u8();
20417 __struct.len = buf.get_u8();
20418 for v in &mut __struct.data {
20419 let val = buf.get_u8();
20420 *v = val;
20421 }
20422 Ok(__struct)
20423 }
20424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20425 let mut __tmp = BytesMut::new(bytes);
20426 #[allow(clippy::absurd_extreme_comparisons)]
20427 #[allow(unused_comparisons)]
20428 if __tmp.remaining() < Self::ENCODED_LEN {
20429 panic!(
20430 "buffer is too small (need {} bytes, but got {})",
20431 Self::ENCODED_LEN,
20432 __tmp.remaining(),
20433 )
20434 }
20435 __tmp.put_u8(self.flags);
20436 __tmp.put_u8(self.len);
20437 for val in &self.data {
20438 __tmp.put_u8(*val);
20439 }
20440 if matches!(version, MavlinkVersion::V2) {
20441 let len = __tmp.len();
20442 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20443 } else {
20444 __tmp.len()
20445 }
20446 }
20447}
20448#[doc = "id: 127"]
20449#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
20450#[derive(Debug, Clone, PartialEq)]
20451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20453pub struct GPS_RTK_DATA {
20454 #[doc = "Time since boot of last baseline message received."]
20455 pub time_last_baseline_ms: u32,
20456 #[doc = "GPS Time of Week of last baseline"]
20457 pub tow: u32,
20458 #[doc = "Current baseline in ECEF x or NED north component."]
20459 pub baseline_a_mm: i32,
20460 #[doc = "Current baseline in ECEF y or NED east component."]
20461 pub baseline_b_mm: i32,
20462 #[doc = "Current baseline in ECEF z or NED down component."]
20463 pub baseline_c_mm: i32,
20464 #[doc = "Current estimate of baseline accuracy."]
20465 pub accuracy: u32,
20466 #[doc = "Current number of integer ambiguity hypotheses."]
20467 pub iar_num_hypotheses: i32,
20468 #[doc = "GPS Week Number of last baseline"]
20469 pub wn: u16,
20470 #[doc = "Identification of connected RTK receiver."]
20471 pub rtk_receiver_id: u8,
20472 #[doc = "GPS-specific health report for RTK data."]
20473 pub rtk_health: u8,
20474 #[doc = "Rate of baseline messages being received by GPS"]
20475 pub rtk_rate: u8,
20476 #[doc = "Current number of sats used for RTK calculation."]
20477 pub nsats: u8,
20478 #[doc = "Coordinate system of baseline"]
20479 pub baseline_coords_type: RtkBaselineCoordinateSystem,
20480}
20481impl GPS_RTK_DATA {
20482 pub const ENCODED_LEN: usize = 35usize;
20483 pub const DEFAULT: Self = Self {
20484 time_last_baseline_ms: 0_u32,
20485 tow: 0_u32,
20486 baseline_a_mm: 0_i32,
20487 baseline_b_mm: 0_i32,
20488 baseline_c_mm: 0_i32,
20489 accuracy: 0_u32,
20490 iar_num_hypotheses: 0_i32,
20491 wn: 0_u16,
20492 rtk_receiver_id: 0_u8,
20493 rtk_health: 0_u8,
20494 rtk_rate: 0_u8,
20495 nsats: 0_u8,
20496 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
20497 };
20498 #[cfg(feature = "arbitrary")]
20499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20500 use arbitrary::{Arbitrary, Unstructured};
20501 let mut buf = [0u8; 1024];
20502 rng.fill_bytes(&mut buf);
20503 let mut unstructured = Unstructured::new(&buf);
20504 Self::arbitrary(&mut unstructured).unwrap_or_default()
20505 }
20506}
20507impl Default for GPS_RTK_DATA {
20508 fn default() -> Self {
20509 Self::DEFAULT.clone()
20510 }
20511}
20512impl MessageData for GPS_RTK_DATA {
20513 type Message = MavMessage;
20514 const ID: u32 = 127u32;
20515 const NAME: &'static str = "GPS_RTK";
20516 const EXTRA_CRC: u8 = 25u8;
20517 const ENCODED_LEN: usize = 35usize;
20518 fn deser(
20519 _version: MavlinkVersion,
20520 __input: &[u8],
20521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20522 let avail_len = __input.len();
20523 let mut payload_buf = [0; Self::ENCODED_LEN];
20524 let mut buf = if avail_len < Self::ENCODED_LEN {
20525 payload_buf[0..avail_len].copy_from_slice(__input);
20526 Bytes::new(&payload_buf)
20527 } else {
20528 Bytes::new(__input)
20529 };
20530 let mut __struct = Self::default();
20531 __struct.time_last_baseline_ms = buf.get_u32_le();
20532 __struct.tow = buf.get_u32_le();
20533 __struct.baseline_a_mm = buf.get_i32_le();
20534 __struct.baseline_b_mm = buf.get_i32_le();
20535 __struct.baseline_c_mm = buf.get_i32_le();
20536 __struct.accuracy = buf.get_u32_le();
20537 __struct.iar_num_hypotheses = buf.get_i32_le();
20538 __struct.wn = buf.get_u16_le();
20539 __struct.rtk_receiver_id = buf.get_u8();
20540 __struct.rtk_health = buf.get_u8();
20541 __struct.rtk_rate = buf.get_u8();
20542 __struct.nsats = buf.get_u8();
20543 let tmp = buf.get_u8();
20544 __struct.baseline_coords_type =
20545 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20546 enum_type: "RtkBaselineCoordinateSystem",
20547 value: tmp as u32,
20548 })?;
20549 Ok(__struct)
20550 }
20551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20552 let mut __tmp = BytesMut::new(bytes);
20553 #[allow(clippy::absurd_extreme_comparisons)]
20554 #[allow(unused_comparisons)]
20555 if __tmp.remaining() < Self::ENCODED_LEN {
20556 panic!(
20557 "buffer is too small (need {} bytes, but got {})",
20558 Self::ENCODED_LEN,
20559 __tmp.remaining(),
20560 )
20561 }
20562 __tmp.put_u32_le(self.time_last_baseline_ms);
20563 __tmp.put_u32_le(self.tow);
20564 __tmp.put_i32_le(self.baseline_a_mm);
20565 __tmp.put_i32_le(self.baseline_b_mm);
20566 __tmp.put_i32_le(self.baseline_c_mm);
20567 __tmp.put_u32_le(self.accuracy);
20568 __tmp.put_i32_le(self.iar_num_hypotheses);
20569 __tmp.put_u16_le(self.wn);
20570 __tmp.put_u8(self.rtk_receiver_id);
20571 __tmp.put_u8(self.rtk_health);
20572 __tmp.put_u8(self.rtk_rate);
20573 __tmp.put_u8(self.nsats);
20574 __tmp.put_u8(self.baseline_coords_type as u8);
20575 if matches!(version, MavlinkVersion::V2) {
20576 let len = __tmp.len();
20577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20578 } else {
20579 __tmp.len()
20580 }
20581 }
20582}
20583#[doc = "id: 25"]
20584#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
20585#[derive(Debug, Clone, PartialEq)]
20586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20588pub struct GPS_STATUS_DATA {
20589 #[doc = "Number of satellites visible"]
20590 pub satellites_visible: u8,
20591 #[doc = "Global satellite ID"]
20592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20593 pub satellite_prn: [u8; 20],
20594 #[doc = "0: Satellite not used, 1: used for localization"]
20595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20596 pub satellite_used: [u8; 20],
20597 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
20598 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20599 pub satellite_elevation: [u8; 20],
20600 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
20601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20602 pub satellite_azimuth: [u8; 20],
20603 #[doc = "Signal to noise ratio of satellite"]
20604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20605 pub satellite_snr: [u8; 20],
20606}
20607impl GPS_STATUS_DATA {
20608 pub const ENCODED_LEN: usize = 101usize;
20609 pub const DEFAULT: Self = Self {
20610 satellites_visible: 0_u8,
20611 satellite_prn: [0_u8; 20usize],
20612 satellite_used: [0_u8; 20usize],
20613 satellite_elevation: [0_u8; 20usize],
20614 satellite_azimuth: [0_u8; 20usize],
20615 satellite_snr: [0_u8; 20usize],
20616 };
20617 #[cfg(feature = "arbitrary")]
20618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20619 use arbitrary::{Arbitrary, Unstructured};
20620 let mut buf = [0u8; 1024];
20621 rng.fill_bytes(&mut buf);
20622 let mut unstructured = Unstructured::new(&buf);
20623 Self::arbitrary(&mut unstructured).unwrap_or_default()
20624 }
20625}
20626impl Default for GPS_STATUS_DATA {
20627 fn default() -> Self {
20628 Self::DEFAULT.clone()
20629 }
20630}
20631impl MessageData for GPS_STATUS_DATA {
20632 type Message = MavMessage;
20633 const ID: u32 = 25u32;
20634 const NAME: &'static str = "GPS_STATUS";
20635 const EXTRA_CRC: u8 = 23u8;
20636 const ENCODED_LEN: usize = 101usize;
20637 fn deser(
20638 _version: MavlinkVersion,
20639 __input: &[u8],
20640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20641 let avail_len = __input.len();
20642 let mut payload_buf = [0; Self::ENCODED_LEN];
20643 let mut buf = if avail_len < Self::ENCODED_LEN {
20644 payload_buf[0..avail_len].copy_from_slice(__input);
20645 Bytes::new(&payload_buf)
20646 } else {
20647 Bytes::new(__input)
20648 };
20649 let mut __struct = Self::default();
20650 __struct.satellites_visible = buf.get_u8();
20651 for v in &mut __struct.satellite_prn {
20652 let val = buf.get_u8();
20653 *v = val;
20654 }
20655 for v in &mut __struct.satellite_used {
20656 let val = buf.get_u8();
20657 *v = val;
20658 }
20659 for v in &mut __struct.satellite_elevation {
20660 let val = buf.get_u8();
20661 *v = val;
20662 }
20663 for v in &mut __struct.satellite_azimuth {
20664 let val = buf.get_u8();
20665 *v = val;
20666 }
20667 for v in &mut __struct.satellite_snr {
20668 let val = buf.get_u8();
20669 *v = val;
20670 }
20671 Ok(__struct)
20672 }
20673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20674 let mut __tmp = BytesMut::new(bytes);
20675 #[allow(clippy::absurd_extreme_comparisons)]
20676 #[allow(unused_comparisons)]
20677 if __tmp.remaining() < Self::ENCODED_LEN {
20678 panic!(
20679 "buffer is too small (need {} bytes, but got {})",
20680 Self::ENCODED_LEN,
20681 __tmp.remaining(),
20682 )
20683 }
20684 __tmp.put_u8(self.satellites_visible);
20685 for val in &self.satellite_prn {
20686 __tmp.put_u8(*val);
20687 }
20688 for val in &self.satellite_used {
20689 __tmp.put_u8(*val);
20690 }
20691 for val in &self.satellite_elevation {
20692 __tmp.put_u8(*val);
20693 }
20694 for val in &self.satellite_azimuth {
20695 __tmp.put_u8(*val);
20696 }
20697 for val in &self.satellite_snr {
20698 __tmp.put_u8(*val);
20699 }
20700 if matches!(version, MavlinkVersion::V2) {
20701 let len = __tmp.len();
20702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20703 } else {
20704 __tmp.len()
20705 }
20706 }
20707}
20708#[doc = "id: 0"]
20709#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
20710#[derive(Debug, Clone, PartialEq)]
20711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20713pub struct HEARTBEAT_DATA {
20714 #[doc = "A bitfield for use for autopilot-specific flags"]
20715 pub custom_mode: u32,
20716 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
20717 pub mavtype: MavType,
20718 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
20719 pub autopilot: MavAutopilot,
20720 #[doc = "System mode bitmap."]
20721 pub base_mode: MavModeFlag,
20722 #[doc = "System status flag."]
20723 pub system_status: MavState,
20724 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
20725 pub mavlink_version: u8,
20726}
20727impl HEARTBEAT_DATA {
20728 pub const ENCODED_LEN: usize = 9usize;
20729 pub const DEFAULT: Self = Self {
20730 custom_mode: 0_u32,
20731 mavtype: MavType::DEFAULT,
20732 autopilot: MavAutopilot::DEFAULT,
20733 base_mode: MavModeFlag::DEFAULT,
20734 system_status: MavState::DEFAULT,
20735 mavlink_version: MINOR_MAVLINK_VERSION,
20736 };
20737 #[cfg(feature = "arbitrary")]
20738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20739 use arbitrary::{Arbitrary, Unstructured};
20740 let mut buf = [0u8; 1024];
20741 rng.fill_bytes(&mut buf);
20742 let mut unstructured = Unstructured::new(&buf);
20743 Self::arbitrary(&mut unstructured).unwrap_or_default()
20744 }
20745}
20746impl Default for HEARTBEAT_DATA {
20747 fn default() -> Self {
20748 Self::DEFAULT.clone()
20749 }
20750}
20751impl MessageData for HEARTBEAT_DATA {
20752 type Message = MavMessage;
20753 const ID: u32 = 0u32;
20754 const NAME: &'static str = "HEARTBEAT";
20755 const EXTRA_CRC: u8 = 50u8;
20756 const ENCODED_LEN: usize = 9usize;
20757 fn deser(
20758 _version: MavlinkVersion,
20759 __input: &[u8],
20760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20761 let avail_len = __input.len();
20762 let mut payload_buf = [0; Self::ENCODED_LEN];
20763 let mut buf = if avail_len < Self::ENCODED_LEN {
20764 payload_buf[0..avail_len].copy_from_slice(__input);
20765 Bytes::new(&payload_buf)
20766 } else {
20767 Bytes::new(__input)
20768 };
20769 let mut __struct = Self::default();
20770 __struct.custom_mode = buf.get_u32_le();
20771 let tmp = buf.get_u8();
20772 __struct.mavtype =
20773 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20774 enum_type: "MavType",
20775 value: tmp as u32,
20776 })?;
20777 let tmp = buf.get_u8();
20778 __struct.autopilot =
20779 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20780 enum_type: "MavAutopilot",
20781 value: tmp as u32,
20782 })?;
20783 let tmp = buf.get_u8();
20784 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
20785 ::mavlink_core::error::ParserError::InvalidFlag {
20786 flag_type: "MavModeFlag",
20787 value: tmp as u32,
20788 },
20789 )?;
20790 let tmp = buf.get_u8();
20791 __struct.system_status =
20792 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20793 enum_type: "MavState",
20794 value: tmp as u32,
20795 })?;
20796 __struct.mavlink_version = buf.get_u8();
20797 Ok(__struct)
20798 }
20799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20800 let mut __tmp = BytesMut::new(bytes);
20801 #[allow(clippy::absurd_extreme_comparisons)]
20802 #[allow(unused_comparisons)]
20803 if __tmp.remaining() < Self::ENCODED_LEN {
20804 panic!(
20805 "buffer is too small (need {} bytes, but got {})",
20806 Self::ENCODED_LEN,
20807 __tmp.remaining(),
20808 )
20809 }
20810 __tmp.put_u32_le(self.custom_mode);
20811 __tmp.put_u8(self.mavtype as u8);
20812 __tmp.put_u8(self.autopilot as u8);
20813 __tmp.put_u8(self.base_mode.bits());
20814 __tmp.put_u8(self.system_status as u8);
20815 __tmp.put_u8(self.mavlink_version);
20816 if matches!(version, MavlinkVersion::V2) {
20817 let len = __tmp.len();
20818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20819 } else {
20820 __tmp.len()
20821 }
20822 }
20823}
20824#[doc = "id: 50003"]
20825#[doc = "Herelink Telemetry."]
20826#[derive(Debug, Clone, PartialEq)]
20827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20829pub struct HERELINK_TELEM_DATA {
20830 pub rf_freq: u32,
20831 pub link_bw: u32,
20832 pub link_rate: u32,
20833 pub snr: i16,
20834 pub cpu_temp: i16,
20835 pub board_temp: i16,
20836 pub rssi: u8,
20837}
20838impl HERELINK_TELEM_DATA {
20839 pub const ENCODED_LEN: usize = 19usize;
20840 pub const DEFAULT: Self = Self {
20841 rf_freq: 0_u32,
20842 link_bw: 0_u32,
20843 link_rate: 0_u32,
20844 snr: 0_i16,
20845 cpu_temp: 0_i16,
20846 board_temp: 0_i16,
20847 rssi: 0_u8,
20848 };
20849 #[cfg(feature = "arbitrary")]
20850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20851 use arbitrary::{Arbitrary, Unstructured};
20852 let mut buf = [0u8; 1024];
20853 rng.fill_bytes(&mut buf);
20854 let mut unstructured = Unstructured::new(&buf);
20855 Self::arbitrary(&mut unstructured).unwrap_or_default()
20856 }
20857}
20858impl Default for HERELINK_TELEM_DATA {
20859 fn default() -> Self {
20860 Self::DEFAULT.clone()
20861 }
20862}
20863impl MessageData for HERELINK_TELEM_DATA {
20864 type Message = MavMessage;
20865 const ID: u32 = 50003u32;
20866 const NAME: &'static str = "HERELINK_TELEM";
20867 const EXTRA_CRC: u8 = 62u8;
20868 const ENCODED_LEN: usize = 19usize;
20869 fn deser(
20870 _version: MavlinkVersion,
20871 __input: &[u8],
20872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20873 let avail_len = __input.len();
20874 let mut payload_buf = [0; Self::ENCODED_LEN];
20875 let mut buf = if avail_len < Self::ENCODED_LEN {
20876 payload_buf[0..avail_len].copy_from_slice(__input);
20877 Bytes::new(&payload_buf)
20878 } else {
20879 Bytes::new(__input)
20880 };
20881 let mut __struct = Self::default();
20882 __struct.rf_freq = buf.get_u32_le();
20883 __struct.link_bw = buf.get_u32_le();
20884 __struct.link_rate = buf.get_u32_le();
20885 __struct.snr = buf.get_i16_le();
20886 __struct.cpu_temp = buf.get_i16_le();
20887 __struct.board_temp = buf.get_i16_le();
20888 __struct.rssi = buf.get_u8();
20889 Ok(__struct)
20890 }
20891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20892 let mut __tmp = BytesMut::new(bytes);
20893 #[allow(clippy::absurd_extreme_comparisons)]
20894 #[allow(unused_comparisons)]
20895 if __tmp.remaining() < Self::ENCODED_LEN {
20896 panic!(
20897 "buffer is too small (need {} bytes, but got {})",
20898 Self::ENCODED_LEN,
20899 __tmp.remaining(),
20900 )
20901 }
20902 __tmp.put_u32_le(self.rf_freq);
20903 __tmp.put_u32_le(self.link_bw);
20904 __tmp.put_u32_le(self.link_rate);
20905 __tmp.put_i16_le(self.snr);
20906 __tmp.put_i16_le(self.cpu_temp);
20907 __tmp.put_i16_le(self.board_temp);
20908 __tmp.put_u8(self.rssi);
20909 if matches!(version, MavlinkVersion::V2) {
20910 let len = __tmp.len();
20911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20912 } else {
20913 __tmp.len()
20914 }
20915 }
20916}
20917#[doc = "id: 50002"]
20918#[doc = "Information about video stream."]
20919#[derive(Debug, Clone, PartialEq)]
20920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20922pub struct HERELINK_VIDEO_STREAM_INFORMATION_DATA {
20923 #[doc = "Frame rate."]
20924 pub framerate: f32,
20925 #[doc = "Bit rate."]
20926 pub bitrate: u32,
20927 #[doc = "Horizontal resolution."]
20928 pub resolution_h: u16,
20929 #[doc = "Vertical resolution."]
20930 pub resolution_v: u16,
20931 #[doc = "Video image rotation clockwise."]
20932 pub rotation: u16,
20933 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
20934 pub camera_id: u8,
20935 #[doc = "Number of streams available."]
20936 pub status: u8,
20937 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
20938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20939 pub uri: [u8; 230],
20940}
20941impl HERELINK_VIDEO_STREAM_INFORMATION_DATA {
20942 pub const ENCODED_LEN: usize = 246usize;
20943 pub const DEFAULT: Self = Self {
20944 framerate: 0.0_f32,
20945 bitrate: 0_u32,
20946 resolution_h: 0_u16,
20947 resolution_v: 0_u16,
20948 rotation: 0_u16,
20949 camera_id: 0_u8,
20950 status: 0_u8,
20951 uri: [0_u8; 230usize],
20952 };
20953 #[cfg(feature = "arbitrary")]
20954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20955 use arbitrary::{Arbitrary, Unstructured};
20956 let mut buf = [0u8; 1024];
20957 rng.fill_bytes(&mut buf);
20958 let mut unstructured = Unstructured::new(&buf);
20959 Self::arbitrary(&mut unstructured).unwrap_or_default()
20960 }
20961}
20962impl Default for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
20963 fn default() -> Self {
20964 Self::DEFAULT.clone()
20965 }
20966}
20967impl MessageData for HERELINK_VIDEO_STREAM_INFORMATION_DATA {
20968 type Message = MavMessage;
20969 const ID: u32 = 50002u32;
20970 const NAME: &'static str = "HERELINK_VIDEO_STREAM_INFORMATION";
20971 const EXTRA_CRC: u8 = 181u8;
20972 const ENCODED_LEN: usize = 246usize;
20973 fn deser(
20974 _version: MavlinkVersion,
20975 __input: &[u8],
20976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20977 let avail_len = __input.len();
20978 let mut payload_buf = [0; Self::ENCODED_LEN];
20979 let mut buf = if avail_len < Self::ENCODED_LEN {
20980 payload_buf[0..avail_len].copy_from_slice(__input);
20981 Bytes::new(&payload_buf)
20982 } else {
20983 Bytes::new(__input)
20984 };
20985 let mut __struct = Self::default();
20986 __struct.framerate = buf.get_f32_le();
20987 __struct.bitrate = buf.get_u32_le();
20988 __struct.resolution_h = buf.get_u16_le();
20989 __struct.resolution_v = buf.get_u16_le();
20990 __struct.rotation = buf.get_u16_le();
20991 __struct.camera_id = buf.get_u8();
20992 __struct.status = buf.get_u8();
20993 for v in &mut __struct.uri {
20994 let val = buf.get_u8();
20995 *v = val;
20996 }
20997 Ok(__struct)
20998 }
20999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21000 let mut __tmp = BytesMut::new(bytes);
21001 #[allow(clippy::absurd_extreme_comparisons)]
21002 #[allow(unused_comparisons)]
21003 if __tmp.remaining() < Self::ENCODED_LEN {
21004 panic!(
21005 "buffer is too small (need {} bytes, but got {})",
21006 Self::ENCODED_LEN,
21007 __tmp.remaining(),
21008 )
21009 }
21010 __tmp.put_f32_le(self.framerate);
21011 __tmp.put_u32_le(self.bitrate);
21012 __tmp.put_u16_le(self.resolution_h);
21013 __tmp.put_u16_le(self.resolution_v);
21014 __tmp.put_u16_le(self.rotation);
21015 __tmp.put_u8(self.camera_id);
21016 __tmp.put_u8(self.status);
21017 for val in &self.uri {
21018 __tmp.put_u8(*val);
21019 }
21020 if matches!(version, MavlinkVersion::V2) {
21021 let len = __tmp.len();
21022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21023 } else {
21024 __tmp.len()
21025 }
21026 }
21027}
21028#[doc = "id: 105"]
21029#[doc = "The IMU readings in SI units in NED body frame."]
21030#[derive(Debug, Clone, PartialEq)]
21031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21033pub struct HIGHRES_IMU_DATA {
21034 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21035 pub time_usec: u64,
21036 #[doc = "X acceleration"]
21037 pub xacc: f32,
21038 #[doc = "Y acceleration"]
21039 pub yacc: f32,
21040 #[doc = "Z acceleration"]
21041 pub zacc: f32,
21042 #[doc = "Angular speed around X axis"]
21043 pub xgyro: f32,
21044 #[doc = "Angular speed around Y axis"]
21045 pub ygyro: f32,
21046 #[doc = "Angular speed around Z axis"]
21047 pub zgyro: f32,
21048 #[doc = "X Magnetic field"]
21049 pub xmag: f32,
21050 #[doc = "Y Magnetic field"]
21051 pub ymag: f32,
21052 #[doc = "Z Magnetic field"]
21053 pub zmag: f32,
21054 #[doc = "Absolute pressure"]
21055 pub abs_pressure: f32,
21056 #[doc = "Differential pressure"]
21057 pub diff_pressure: f32,
21058 #[doc = "Altitude calculated from pressure"]
21059 pub pressure_alt: f32,
21060 #[doc = "Temperature"]
21061 pub temperature: f32,
21062 #[doc = "Bitmap for fields that have updated since last message"]
21063 pub fields_updated: HighresImuUpdatedFlags,
21064 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
21065 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21066 pub id: u8,
21067}
21068impl HIGHRES_IMU_DATA {
21069 pub const ENCODED_LEN: usize = 63usize;
21070 pub const DEFAULT: Self = Self {
21071 time_usec: 0_u64,
21072 xacc: 0.0_f32,
21073 yacc: 0.0_f32,
21074 zacc: 0.0_f32,
21075 xgyro: 0.0_f32,
21076 ygyro: 0.0_f32,
21077 zgyro: 0.0_f32,
21078 xmag: 0.0_f32,
21079 ymag: 0.0_f32,
21080 zmag: 0.0_f32,
21081 abs_pressure: 0.0_f32,
21082 diff_pressure: 0.0_f32,
21083 pressure_alt: 0.0_f32,
21084 temperature: 0.0_f32,
21085 fields_updated: HighresImuUpdatedFlags::DEFAULT,
21086 id: 0_u8,
21087 };
21088 #[cfg(feature = "arbitrary")]
21089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21090 use arbitrary::{Arbitrary, Unstructured};
21091 let mut buf = [0u8; 1024];
21092 rng.fill_bytes(&mut buf);
21093 let mut unstructured = Unstructured::new(&buf);
21094 Self::arbitrary(&mut unstructured).unwrap_or_default()
21095 }
21096}
21097impl Default for HIGHRES_IMU_DATA {
21098 fn default() -> Self {
21099 Self::DEFAULT.clone()
21100 }
21101}
21102impl MessageData for HIGHRES_IMU_DATA {
21103 type Message = MavMessage;
21104 const ID: u32 = 105u32;
21105 const NAME: &'static str = "HIGHRES_IMU";
21106 const EXTRA_CRC: u8 = 93u8;
21107 const ENCODED_LEN: usize = 63usize;
21108 fn deser(
21109 _version: MavlinkVersion,
21110 __input: &[u8],
21111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21112 let avail_len = __input.len();
21113 let mut payload_buf = [0; Self::ENCODED_LEN];
21114 let mut buf = if avail_len < Self::ENCODED_LEN {
21115 payload_buf[0..avail_len].copy_from_slice(__input);
21116 Bytes::new(&payload_buf)
21117 } else {
21118 Bytes::new(__input)
21119 };
21120 let mut __struct = Self::default();
21121 __struct.time_usec = buf.get_u64_le();
21122 __struct.xacc = buf.get_f32_le();
21123 __struct.yacc = buf.get_f32_le();
21124 __struct.zacc = buf.get_f32_le();
21125 __struct.xgyro = buf.get_f32_le();
21126 __struct.ygyro = buf.get_f32_le();
21127 __struct.zgyro = buf.get_f32_le();
21128 __struct.xmag = buf.get_f32_le();
21129 __struct.ymag = buf.get_f32_le();
21130 __struct.zmag = buf.get_f32_le();
21131 __struct.abs_pressure = buf.get_f32_le();
21132 __struct.diff_pressure = buf.get_f32_le();
21133 __struct.pressure_alt = buf.get_f32_le();
21134 __struct.temperature = buf.get_f32_le();
21135 let tmp = buf.get_u16_le();
21136 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
21137 tmp & HighresImuUpdatedFlags::all().bits(),
21138 )
21139 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21140 flag_type: "HighresImuUpdatedFlags",
21141 value: tmp as u32,
21142 })?;
21143 __struct.id = buf.get_u8();
21144 Ok(__struct)
21145 }
21146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21147 let mut __tmp = BytesMut::new(bytes);
21148 #[allow(clippy::absurd_extreme_comparisons)]
21149 #[allow(unused_comparisons)]
21150 if __tmp.remaining() < Self::ENCODED_LEN {
21151 panic!(
21152 "buffer is too small (need {} bytes, but got {})",
21153 Self::ENCODED_LEN,
21154 __tmp.remaining(),
21155 )
21156 }
21157 __tmp.put_u64_le(self.time_usec);
21158 __tmp.put_f32_le(self.xacc);
21159 __tmp.put_f32_le(self.yacc);
21160 __tmp.put_f32_le(self.zacc);
21161 __tmp.put_f32_le(self.xgyro);
21162 __tmp.put_f32_le(self.ygyro);
21163 __tmp.put_f32_le(self.zgyro);
21164 __tmp.put_f32_le(self.xmag);
21165 __tmp.put_f32_le(self.ymag);
21166 __tmp.put_f32_le(self.zmag);
21167 __tmp.put_f32_le(self.abs_pressure);
21168 __tmp.put_f32_le(self.diff_pressure);
21169 __tmp.put_f32_le(self.pressure_alt);
21170 __tmp.put_f32_le(self.temperature);
21171 __tmp.put_u16_le(self.fields_updated.bits());
21172 __tmp.put_u8(self.id);
21173 if matches!(version, MavlinkVersion::V2) {
21174 let len = __tmp.len();
21175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21176 } else {
21177 __tmp.len()
21178 }
21179 }
21180}
21181#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
21182#[doc = "id: 234"]
21183#[doc = "Message appropriate for high latency connections like Iridium."]
21184#[derive(Debug, Clone, PartialEq)]
21185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21187pub struct HIGH_LATENCY_DATA {
21188 #[doc = "A bitfield for use for autopilot-specific flags."]
21189 pub custom_mode: u32,
21190 #[doc = "Latitude"]
21191 pub latitude: i32,
21192 #[doc = "Longitude"]
21193 pub longitude: i32,
21194 #[doc = "roll"]
21195 pub roll: i16,
21196 #[doc = "pitch"]
21197 pub pitch: i16,
21198 #[doc = "heading"]
21199 pub heading: u16,
21200 #[doc = "heading setpoint"]
21201 pub heading_sp: i16,
21202 #[doc = "Altitude above mean sea level"]
21203 pub altitude_amsl: i16,
21204 #[doc = "Altitude setpoint relative to the home position"]
21205 pub altitude_sp: i16,
21206 #[doc = "distance to target"]
21207 pub wp_distance: u16,
21208 #[doc = "Bitmap of enabled system modes."]
21209 pub base_mode: MavModeFlag,
21210 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
21211 pub landed_state: MavLandedState,
21212 #[doc = "throttle (percentage)"]
21213 pub throttle: i8,
21214 #[doc = "airspeed"]
21215 pub airspeed: u8,
21216 #[doc = "airspeed setpoint"]
21217 pub airspeed_sp: u8,
21218 #[doc = "groundspeed"]
21219 pub groundspeed: u8,
21220 #[doc = "climb rate"]
21221 pub climb_rate: i8,
21222 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
21223 pub gps_nsat: u8,
21224 #[doc = "GPS Fix type."]
21225 pub gps_fix_type: GpsFixType,
21226 #[doc = "Remaining battery (percentage)"]
21227 pub battery_remaining: u8,
21228 #[doc = "Autopilot temperature (degrees C)"]
21229 pub temperature: i8,
21230 #[doc = "Air temperature (degrees C) from airspeed sensor"]
21231 pub temperature_air: i8,
21232 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
21233 pub failsafe: u8,
21234 #[doc = "current waypoint number"]
21235 pub wp_num: u8,
21236}
21237impl HIGH_LATENCY_DATA {
21238 pub const ENCODED_LEN: usize = 40usize;
21239 pub const DEFAULT: Self = Self {
21240 custom_mode: 0_u32,
21241 latitude: 0_i32,
21242 longitude: 0_i32,
21243 roll: 0_i16,
21244 pitch: 0_i16,
21245 heading: 0_u16,
21246 heading_sp: 0_i16,
21247 altitude_amsl: 0_i16,
21248 altitude_sp: 0_i16,
21249 wp_distance: 0_u16,
21250 base_mode: MavModeFlag::DEFAULT,
21251 landed_state: MavLandedState::DEFAULT,
21252 throttle: 0_i8,
21253 airspeed: 0_u8,
21254 airspeed_sp: 0_u8,
21255 groundspeed: 0_u8,
21256 climb_rate: 0_i8,
21257 gps_nsat: 0_u8,
21258 gps_fix_type: GpsFixType::DEFAULT,
21259 battery_remaining: 0_u8,
21260 temperature: 0_i8,
21261 temperature_air: 0_i8,
21262 failsafe: 0_u8,
21263 wp_num: 0_u8,
21264 };
21265 #[cfg(feature = "arbitrary")]
21266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21267 use arbitrary::{Arbitrary, Unstructured};
21268 let mut buf = [0u8; 1024];
21269 rng.fill_bytes(&mut buf);
21270 let mut unstructured = Unstructured::new(&buf);
21271 Self::arbitrary(&mut unstructured).unwrap_or_default()
21272 }
21273}
21274impl Default for HIGH_LATENCY_DATA {
21275 fn default() -> Self {
21276 Self::DEFAULT.clone()
21277 }
21278}
21279impl MessageData for HIGH_LATENCY_DATA {
21280 type Message = MavMessage;
21281 const ID: u32 = 234u32;
21282 const NAME: &'static str = "HIGH_LATENCY";
21283 const EXTRA_CRC: u8 = 150u8;
21284 const ENCODED_LEN: usize = 40usize;
21285 fn deser(
21286 _version: MavlinkVersion,
21287 __input: &[u8],
21288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21289 let avail_len = __input.len();
21290 let mut payload_buf = [0; Self::ENCODED_LEN];
21291 let mut buf = if avail_len < Self::ENCODED_LEN {
21292 payload_buf[0..avail_len].copy_from_slice(__input);
21293 Bytes::new(&payload_buf)
21294 } else {
21295 Bytes::new(__input)
21296 };
21297 let mut __struct = Self::default();
21298 __struct.custom_mode = buf.get_u32_le();
21299 __struct.latitude = buf.get_i32_le();
21300 __struct.longitude = buf.get_i32_le();
21301 __struct.roll = buf.get_i16_le();
21302 __struct.pitch = buf.get_i16_le();
21303 __struct.heading = buf.get_u16_le();
21304 __struct.heading_sp = buf.get_i16_le();
21305 __struct.altitude_amsl = buf.get_i16_le();
21306 __struct.altitude_sp = buf.get_i16_le();
21307 __struct.wp_distance = buf.get_u16_le();
21308 let tmp = buf.get_u8();
21309 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
21310 ::mavlink_core::error::ParserError::InvalidFlag {
21311 flag_type: "MavModeFlag",
21312 value: tmp as u32,
21313 },
21314 )?;
21315 let tmp = buf.get_u8();
21316 __struct.landed_state =
21317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21318 enum_type: "MavLandedState",
21319 value: tmp as u32,
21320 })?;
21321 __struct.throttle = buf.get_i8();
21322 __struct.airspeed = buf.get_u8();
21323 __struct.airspeed_sp = buf.get_u8();
21324 __struct.groundspeed = buf.get_u8();
21325 __struct.climb_rate = buf.get_i8();
21326 __struct.gps_nsat = buf.get_u8();
21327 let tmp = buf.get_u8();
21328 __struct.gps_fix_type =
21329 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21330 enum_type: "GpsFixType",
21331 value: tmp as u32,
21332 })?;
21333 __struct.battery_remaining = buf.get_u8();
21334 __struct.temperature = buf.get_i8();
21335 __struct.temperature_air = buf.get_i8();
21336 __struct.failsafe = buf.get_u8();
21337 __struct.wp_num = buf.get_u8();
21338 Ok(__struct)
21339 }
21340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21341 let mut __tmp = BytesMut::new(bytes);
21342 #[allow(clippy::absurd_extreme_comparisons)]
21343 #[allow(unused_comparisons)]
21344 if __tmp.remaining() < Self::ENCODED_LEN {
21345 panic!(
21346 "buffer is too small (need {} bytes, but got {})",
21347 Self::ENCODED_LEN,
21348 __tmp.remaining(),
21349 )
21350 }
21351 __tmp.put_u32_le(self.custom_mode);
21352 __tmp.put_i32_le(self.latitude);
21353 __tmp.put_i32_le(self.longitude);
21354 __tmp.put_i16_le(self.roll);
21355 __tmp.put_i16_le(self.pitch);
21356 __tmp.put_u16_le(self.heading);
21357 __tmp.put_i16_le(self.heading_sp);
21358 __tmp.put_i16_le(self.altitude_amsl);
21359 __tmp.put_i16_le(self.altitude_sp);
21360 __tmp.put_u16_le(self.wp_distance);
21361 __tmp.put_u8(self.base_mode.bits());
21362 __tmp.put_u8(self.landed_state as u8);
21363 __tmp.put_i8(self.throttle);
21364 __tmp.put_u8(self.airspeed);
21365 __tmp.put_u8(self.airspeed_sp);
21366 __tmp.put_u8(self.groundspeed);
21367 __tmp.put_i8(self.climb_rate);
21368 __tmp.put_u8(self.gps_nsat);
21369 __tmp.put_u8(self.gps_fix_type as u8);
21370 __tmp.put_u8(self.battery_remaining);
21371 __tmp.put_i8(self.temperature);
21372 __tmp.put_i8(self.temperature_air);
21373 __tmp.put_u8(self.failsafe);
21374 __tmp.put_u8(self.wp_num);
21375 if matches!(version, MavlinkVersion::V2) {
21376 let len = __tmp.len();
21377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21378 } else {
21379 __tmp.len()
21380 }
21381 }
21382}
21383#[doc = "id: 235"]
21384#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
21385#[derive(Debug, Clone, PartialEq)]
21386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21388pub struct HIGH_LATENCY2_DATA {
21389 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
21390 pub timestamp: u32,
21391 #[doc = "Latitude"]
21392 pub latitude: i32,
21393 #[doc = "Longitude"]
21394 pub longitude: i32,
21395 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
21396 pub custom_mode: u16,
21397 #[doc = "Altitude above mean sea level"]
21398 pub altitude: i16,
21399 #[doc = "Altitude setpoint"]
21400 pub target_altitude: i16,
21401 #[doc = "Distance to target waypoint or position"]
21402 pub target_distance: u16,
21403 #[doc = "Current waypoint number"]
21404 pub wp_num: u16,
21405 #[doc = "Bitmap of failure flags."]
21406 pub failure_flags: HlFailureFlag,
21407 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
21408 pub mavtype: MavType,
21409 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
21410 pub autopilot: MavAutopilot,
21411 #[doc = "Heading"]
21412 pub heading: u8,
21413 #[doc = "Heading setpoint"]
21414 pub target_heading: u8,
21415 #[doc = "Throttle"]
21416 pub throttle: u8,
21417 #[doc = "Airspeed"]
21418 pub airspeed: u8,
21419 #[doc = "Airspeed setpoint"]
21420 pub airspeed_sp: u8,
21421 #[doc = "Groundspeed"]
21422 pub groundspeed: u8,
21423 #[doc = "Windspeed"]
21424 pub windspeed: u8,
21425 #[doc = "Wind heading"]
21426 pub wind_heading: u8,
21427 #[doc = "Maximum error horizontal position since last message"]
21428 pub eph: u8,
21429 #[doc = "Maximum error vertical position since last message"]
21430 pub epv: u8,
21431 #[doc = "Air temperature"]
21432 pub temperature_air: i8,
21433 #[doc = "Maximum climb rate magnitude since last message"]
21434 pub climb_rate: i8,
21435 #[doc = "Battery level (-1 if field not provided)."]
21436 pub battery: i8,
21437 #[doc = "Field for custom payload."]
21438 pub custom0: i8,
21439 #[doc = "Field for custom payload."]
21440 pub custom1: i8,
21441 #[doc = "Field for custom payload."]
21442 pub custom2: i8,
21443}
21444impl HIGH_LATENCY2_DATA {
21445 pub const ENCODED_LEN: usize = 42usize;
21446 pub const DEFAULT: Self = Self {
21447 timestamp: 0_u32,
21448 latitude: 0_i32,
21449 longitude: 0_i32,
21450 custom_mode: 0_u16,
21451 altitude: 0_i16,
21452 target_altitude: 0_i16,
21453 target_distance: 0_u16,
21454 wp_num: 0_u16,
21455 failure_flags: HlFailureFlag::DEFAULT,
21456 mavtype: MavType::DEFAULT,
21457 autopilot: MavAutopilot::DEFAULT,
21458 heading: 0_u8,
21459 target_heading: 0_u8,
21460 throttle: 0_u8,
21461 airspeed: 0_u8,
21462 airspeed_sp: 0_u8,
21463 groundspeed: 0_u8,
21464 windspeed: 0_u8,
21465 wind_heading: 0_u8,
21466 eph: 0_u8,
21467 epv: 0_u8,
21468 temperature_air: 0_i8,
21469 climb_rate: 0_i8,
21470 battery: 0_i8,
21471 custom0: 0_i8,
21472 custom1: 0_i8,
21473 custom2: 0_i8,
21474 };
21475 #[cfg(feature = "arbitrary")]
21476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21477 use arbitrary::{Arbitrary, Unstructured};
21478 let mut buf = [0u8; 1024];
21479 rng.fill_bytes(&mut buf);
21480 let mut unstructured = Unstructured::new(&buf);
21481 Self::arbitrary(&mut unstructured).unwrap_or_default()
21482 }
21483}
21484impl Default for HIGH_LATENCY2_DATA {
21485 fn default() -> Self {
21486 Self::DEFAULT.clone()
21487 }
21488}
21489impl MessageData for HIGH_LATENCY2_DATA {
21490 type Message = MavMessage;
21491 const ID: u32 = 235u32;
21492 const NAME: &'static str = "HIGH_LATENCY2";
21493 const EXTRA_CRC: u8 = 179u8;
21494 const ENCODED_LEN: usize = 42usize;
21495 fn deser(
21496 _version: MavlinkVersion,
21497 __input: &[u8],
21498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21499 let avail_len = __input.len();
21500 let mut payload_buf = [0; Self::ENCODED_LEN];
21501 let mut buf = if avail_len < Self::ENCODED_LEN {
21502 payload_buf[0..avail_len].copy_from_slice(__input);
21503 Bytes::new(&payload_buf)
21504 } else {
21505 Bytes::new(__input)
21506 };
21507 let mut __struct = Self::default();
21508 __struct.timestamp = buf.get_u32_le();
21509 __struct.latitude = buf.get_i32_le();
21510 __struct.longitude = buf.get_i32_le();
21511 __struct.custom_mode = buf.get_u16_le();
21512 __struct.altitude = buf.get_i16_le();
21513 __struct.target_altitude = buf.get_i16_le();
21514 __struct.target_distance = buf.get_u16_le();
21515 __struct.wp_num = buf.get_u16_le();
21516 let tmp = buf.get_u16_le();
21517 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
21518 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21519 flag_type: "HlFailureFlag",
21520 value: tmp as u32,
21521 })?;
21522 let tmp = buf.get_u8();
21523 __struct.mavtype =
21524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21525 enum_type: "MavType",
21526 value: tmp as u32,
21527 })?;
21528 let tmp = buf.get_u8();
21529 __struct.autopilot =
21530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21531 enum_type: "MavAutopilot",
21532 value: tmp as u32,
21533 })?;
21534 __struct.heading = buf.get_u8();
21535 __struct.target_heading = buf.get_u8();
21536 __struct.throttle = buf.get_u8();
21537 __struct.airspeed = buf.get_u8();
21538 __struct.airspeed_sp = buf.get_u8();
21539 __struct.groundspeed = buf.get_u8();
21540 __struct.windspeed = buf.get_u8();
21541 __struct.wind_heading = buf.get_u8();
21542 __struct.eph = buf.get_u8();
21543 __struct.epv = buf.get_u8();
21544 __struct.temperature_air = buf.get_i8();
21545 __struct.climb_rate = buf.get_i8();
21546 __struct.battery = buf.get_i8();
21547 __struct.custom0 = buf.get_i8();
21548 __struct.custom1 = buf.get_i8();
21549 __struct.custom2 = buf.get_i8();
21550 Ok(__struct)
21551 }
21552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21553 let mut __tmp = BytesMut::new(bytes);
21554 #[allow(clippy::absurd_extreme_comparisons)]
21555 #[allow(unused_comparisons)]
21556 if __tmp.remaining() < Self::ENCODED_LEN {
21557 panic!(
21558 "buffer is too small (need {} bytes, but got {})",
21559 Self::ENCODED_LEN,
21560 __tmp.remaining(),
21561 )
21562 }
21563 __tmp.put_u32_le(self.timestamp);
21564 __tmp.put_i32_le(self.latitude);
21565 __tmp.put_i32_le(self.longitude);
21566 __tmp.put_u16_le(self.custom_mode);
21567 __tmp.put_i16_le(self.altitude);
21568 __tmp.put_i16_le(self.target_altitude);
21569 __tmp.put_u16_le(self.target_distance);
21570 __tmp.put_u16_le(self.wp_num);
21571 __tmp.put_u16_le(self.failure_flags.bits());
21572 __tmp.put_u8(self.mavtype as u8);
21573 __tmp.put_u8(self.autopilot as u8);
21574 __tmp.put_u8(self.heading);
21575 __tmp.put_u8(self.target_heading);
21576 __tmp.put_u8(self.throttle);
21577 __tmp.put_u8(self.airspeed);
21578 __tmp.put_u8(self.airspeed_sp);
21579 __tmp.put_u8(self.groundspeed);
21580 __tmp.put_u8(self.windspeed);
21581 __tmp.put_u8(self.wind_heading);
21582 __tmp.put_u8(self.eph);
21583 __tmp.put_u8(self.epv);
21584 __tmp.put_i8(self.temperature_air);
21585 __tmp.put_i8(self.climb_rate);
21586 __tmp.put_i8(self.battery);
21587 __tmp.put_i8(self.custom0);
21588 __tmp.put_i8(self.custom1);
21589 __tmp.put_i8(self.custom2);
21590 if matches!(version, MavlinkVersion::V2) {
21591 let len = __tmp.len();
21592 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21593 } else {
21594 __tmp.len()
21595 }
21596 }
21597}
21598#[doc = "id: 93"]
21599#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
21600#[derive(Debug, Clone, PartialEq)]
21601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21603pub struct HIL_ACTUATOR_CONTROLS_DATA {
21604 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21605 pub time_usec: u64,
21606 #[doc = "Flags bitmask."]
21607 pub flags: HilActuatorControlsFlags,
21608 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
21609 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21610 pub controls: [f32; 16],
21611 #[doc = "System mode. Includes arming state."]
21612 pub mode: MavModeFlag,
21613}
21614impl HIL_ACTUATOR_CONTROLS_DATA {
21615 pub const ENCODED_LEN: usize = 81usize;
21616 pub const DEFAULT: Self = Self {
21617 time_usec: 0_u64,
21618 flags: HilActuatorControlsFlags::DEFAULT,
21619 controls: [0.0_f32; 16usize],
21620 mode: MavModeFlag::DEFAULT,
21621 };
21622 #[cfg(feature = "arbitrary")]
21623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21624 use arbitrary::{Arbitrary, Unstructured};
21625 let mut buf = [0u8; 1024];
21626 rng.fill_bytes(&mut buf);
21627 let mut unstructured = Unstructured::new(&buf);
21628 Self::arbitrary(&mut unstructured).unwrap_or_default()
21629 }
21630}
21631impl Default for HIL_ACTUATOR_CONTROLS_DATA {
21632 fn default() -> Self {
21633 Self::DEFAULT.clone()
21634 }
21635}
21636impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
21637 type Message = MavMessage;
21638 const ID: u32 = 93u32;
21639 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
21640 const EXTRA_CRC: u8 = 47u8;
21641 const ENCODED_LEN: usize = 81usize;
21642 fn deser(
21643 _version: MavlinkVersion,
21644 __input: &[u8],
21645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21646 let avail_len = __input.len();
21647 let mut payload_buf = [0; Self::ENCODED_LEN];
21648 let mut buf = if avail_len < Self::ENCODED_LEN {
21649 payload_buf[0..avail_len].copy_from_slice(__input);
21650 Bytes::new(&payload_buf)
21651 } else {
21652 Bytes::new(__input)
21653 };
21654 let mut __struct = Self::default();
21655 __struct.time_usec = buf.get_u64_le();
21656 let tmp = buf.get_u64_le();
21657 __struct.flags =
21658 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
21659 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
21660 flag_type: "HilActuatorControlsFlags",
21661 value: tmp as u32,
21662 })?;
21663 for v in &mut __struct.controls {
21664 let val = buf.get_f32_le();
21665 *v = val;
21666 }
21667 let tmp = buf.get_u8();
21668 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
21669 ::mavlink_core::error::ParserError::InvalidFlag {
21670 flag_type: "MavModeFlag",
21671 value: tmp as u32,
21672 },
21673 )?;
21674 Ok(__struct)
21675 }
21676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21677 let mut __tmp = BytesMut::new(bytes);
21678 #[allow(clippy::absurd_extreme_comparisons)]
21679 #[allow(unused_comparisons)]
21680 if __tmp.remaining() < Self::ENCODED_LEN {
21681 panic!(
21682 "buffer is too small (need {} bytes, but got {})",
21683 Self::ENCODED_LEN,
21684 __tmp.remaining(),
21685 )
21686 }
21687 __tmp.put_u64_le(self.time_usec);
21688 __tmp.put_u64_le(self.flags.bits());
21689 for val in &self.controls {
21690 __tmp.put_f32_le(*val);
21691 }
21692 __tmp.put_u8(self.mode.bits());
21693 if matches!(version, MavlinkVersion::V2) {
21694 let len = __tmp.len();
21695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21696 } else {
21697 __tmp.len()
21698 }
21699 }
21700}
21701#[doc = "id: 91"]
21702#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
21703#[derive(Debug, Clone, PartialEq)]
21704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21706pub struct HIL_CONTROLS_DATA {
21707 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21708 pub time_usec: u64,
21709 #[doc = "Control output -1 .. 1"]
21710 pub roll_ailerons: f32,
21711 #[doc = "Control output -1 .. 1"]
21712 pub pitch_elevator: f32,
21713 #[doc = "Control output -1 .. 1"]
21714 pub yaw_rudder: f32,
21715 #[doc = "Throttle 0 .. 1"]
21716 pub throttle: f32,
21717 #[doc = "Aux 1, -1 .. 1"]
21718 pub aux1: f32,
21719 #[doc = "Aux 2, -1 .. 1"]
21720 pub aux2: f32,
21721 #[doc = "Aux 3, -1 .. 1"]
21722 pub aux3: f32,
21723 #[doc = "Aux 4, -1 .. 1"]
21724 pub aux4: f32,
21725 #[doc = "System mode."]
21726 pub mode: MavMode,
21727 #[doc = "Navigation mode (MAV_NAV_MODE)"]
21728 pub nav_mode: u8,
21729}
21730impl HIL_CONTROLS_DATA {
21731 pub const ENCODED_LEN: usize = 42usize;
21732 pub const DEFAULT: Self = Self {
21733 time_usec: 0_u64,
21734 roll_ailerons: 0.0_f32,
21735 pitch_elevator: 0.0_f32,
21736 yaw_rudder: 0.0_f32,
21737 throttle: 0.0_f32,
21738 aux1: 0.0_f32,
21739 aux2: 0.0_f32,
21740 aux3: 0.0_f32,
21741 aux4: 0.0_f32,
21742 mode: MavMode::DEFAULT,
21743 nav_mode: 0_u8,
21744 };
21745 #[cfg(feature = "arbitrary")]
21746 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21747 use arbitrary::{Arbitrary, Unstructured};
21748 let mut buf = [0u8; 1024];
21749 rng.fill_bytes(&mut buf);
21750 let mut unstructured = Unstructured::new(&buf);
21751 Self::arbitrary(&mut unstructured).unwrap_or_default()
21752 }
21753}
21754impl Default for HIL_CONTROLS_DATA {
21755 fn default() -> Self {
21756 Self::DEFAULT.clone()
21757 }
21758}
21759impl MessageData for HIL_CONTROLS_DATA {
21760 type Message = MavMessage;
21761 const ID: u32 = 91u32;
21762 const NAME: &'static str = "HIL_CONTROLS";
21763 const EXTRA_CRC: u8 = 63u8;
21764 const ENCODED_LEN: usize = 42usize;
21765 fn deser(
21766 _version: MavlinkVersion,
21767 __input: &[u8],
21768 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21769 let avail_len = __input.len();
21770 let mut payload_buf = [0; Self::ENCODED_LEN];
21771 let mut buf = if avail_len < Self::ENCODED_LEN {
21772 payload_buf[0..avail_len].copy_from_slice(__input);
21773 Bytes::new(&payload_buf)
21774 } else {
21775 Bytes::new(__input)
21776 };
21777 let mut __struct = Self::default();
21778 __struct.time_usec = buf.get_u64_le();
21779 __struct.roll_ailerons = buf.get_f32_le();
21780 __struct.pitch_elevator = buf.get_f32_le();
21781 __struct.yaw_rudder = buf.get_f32_le();
21782 __struct.throttle = buf.get_f32_le();
21783 __struct.aux1 = buf.get_f32_le();
21784 __struct.aux2 = buf.get_f32_le();
21785 __struct.aux3 = buf.get_f32_le();
21786 __struct.aux4 = buf.get_f32_le();
21787 let tmp = buf.get_u8();
21788 __struct.mode =
21789 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21790 enum_type: "MavMode",
21791 value: tmp as u32,
21792 })?;
21793 __struct.nav_mode = buf.get_u8();
21794 Ok(__struct)
21795 }
21796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21797 let mut __tmp = BytesMut::new(bytes);
21798 #[allow(clippy::absurd_extreme_comparisons)]
21799 #[allow(unused_comparisons)]
21800 if __tmp.remaining() < Self::ENCODED_LEN {
21801 panic!(
21802 "buffer is too small (need {} bytes, but got {})",
21803 Self::ENCODED_LEN,
21804 __tmp.remaining(),
21805 )
21806 }
21807 __tmp.put_u64_le(self.time_usec);
21808 __tmp.put_f32_le(self.roll_ailerons);
21809 __tmp.put_f32_le(self.pitch_elevator);
21810 __tmp.put_f32_le(self.yaw_rudder);
21811 __tmp.put_f32_le(self.throttle);
21812 __tmp.put_f32_le(self.aux1);
21813 __tmp.put_f32_le(self.aux2);
21814 __tmp.put_f32_le(self.aux3);
21815 __tmp.put_f32_le(self.aux4);
21816 __tmp.put_u8(self.mode as u8);
21817 __tmp.put_u8(self.nav_mode);
21818 if matches!(version, MavlinkVersion::V2) {
21819 let len = __tmp.len();
21820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21821 } else {
21822 __tmp.len()
21823 }
21824 }
21825}
21826#[doc = "id: 113"]
21827#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
21828#[derive(Debug, Clone, PartialEq)]
21829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21831pub struct HIL_GPS_DATA {
21832 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21833 pub time_usec: u64,
21834 #[doc = "Latitude (WGS84)"]
21835 pub lat: i32,
21836 #[doc = "Longitude (WGS84)"]
21837 pub lon: i32,
21838 #[doc = "Altitude (MSL). Positive for up."]
21839 pub alt: i32,
21840 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
21841 pub eph: u16,
21842 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
21843 pub epv: u16,
21844 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
21845 pub vel: u16,
21846 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
21847 pub vn: i16,
21848 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
21849 pub ve: i16,
21850 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
21851 pub vd: i16,
21852 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
21853 pub cog: u16,
21854 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
21855 pub fix_type: u8,
21856 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
21857 pub satellites_visible: u8,
21858 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
21859 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21860 pub id: u8,
21861 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
21862 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21863 pub yaw: u16,
21864}
21865impl HIL_GPS_DATA {
21866 pub const ENCODED_LEN: usize = 39usize;
21867 pub const DEFAULT: Self = Self {
21868 time_usec: 0_u64,
21869 lat: 0_i32,
21870 lon: 0_i32,
21871 alt: 0_i32,
21872 eph: 0_u16,
21873 epv: 0_u16,
21874 vel: 0_u16,
21875 vn: 0_i16,
21876 ve: 0_i16,
21877 vd: 0_i16,
21878 cog: 0_u16,
21879 fix_type: 0_u8,
21880 satellites_visible: 0_u8,
21881 id: 0_u8,
21882 yaw: 0_u16,
21883 };
21884 #[cfg(feature = "arbitrary")]
21885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21886 use arbitrary::{Arbitrary, Unstructured};
21887 let mut buf = [0u8; 1024];
21888 rng.fill_bytes(&mut buf);
21889 let mut unstructured = Unstructured::new(&buf);
21890 Self::arbitrary(&mut unstructured).unwrap_or_default()
21891 }
21892}
21893impl Default for HIL_GPS_DATA {
21894 fn default() -> Self {
21895 Self::DEFAULT.clone()
21896 }
21897}
21898impl MessageData for HIL_GPS_DATA {
21899 type Message = MavMessage;
21900 const ID: u32 = 113u32;
21901 const NAME: &'static str = "HIL_GPS";
21902 const EXTRA_CRC: u8 = 124u8;
21903 const ENCODED_LEN: usize = 39usize;
21904 fn deser(
21905 _version: MavlinkVersion,
21906 __input: &[u8],
21907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21908 let avail_len = __input.len();
21909 let mut payload_buf = [0; Self::ENCODED_LEN];
21910 let mut buf = if avail_len < Self::ENCODED_LEN {
21911 payload_buf[0..avail_len].copy_from_slice(__input);
21912 Bytes::new(&payload_buf)
21913 } else {
21914 Bytes::new(__input)
21915 };
21916 let mut __struct = Self::default();
21917 __struct.time_usec = buf.get_u64_le();
21918 __struct.lat = buf.get_i32_le();
21919 __struct.lon = buf.get_i32_le();
21920 __struct.alt = buf.get_i32_le();
21921 __struct.eph = buf.get_u16_le();
21922 __struct.epv = buf.get_u16_le();
21923 __struct.vel = buf.get_u16_le();
21924 __struct.vn = buf.get_i16_le();
21925 __struct.ve = buf.get_i16_le();
21926 __struct.vd = buf.get_i16_le();
21927 __struct.cog = buf.get_u16_le();
21928 __struct.fix_type = buf.get_u8();
21929 __struct.satellites_visible = buf.get_u8();
21930 __struct.id = buf.get_u8();
21931 __struct.yaw = buf.get_u16_le();
21932 Ok(__struct)
21933 }
21934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21935 let mut __tmp = BytesMut::new(bytes);
21936 #[allow(clippy::absurd_extreme_comparisons)]
21937 #[allow(unused_comparisons)]
21938 if __tmp.remaining() < Self::ENCODED_LEN {
21939 panic!(
21940 "buffer is too small (need {} bytes, but got {})",
21941 Self::ENCODED_LEN,
21942 __tmp.remaining(),
21943 )
21944 }
21945 __tmp.put_u64_le(self.time_usec);
21946 __tmp.put_i32_le(self.lat);
21947 __tmp.put_i32_le(self.lon);
21948 __tmp.put_i32_le(self.alt);
21949 __tmp.put_u16_le(self.eph);
21950 __tmp.put_u16_le(self.epv);
21951 __tmp.put_u16_le(self.vel);
21952 __tmp.put_i16_le(self.vn);
21953 __tmp.put_i16_le(self.ve);
21954 __tmp.put_i16_le(self.vd);
21955 __tmp.put_u16_le(self.cog);
21956 __tmp.put_u8(self.fix_type);
21957 __tmp.put_u8(self.satellites_visible);
21958 __tmp.put_u8(self.id);
21959 __tmp.put_u16_le(self.yaw);
21960 if matches!(version, MavlinkVersion::V2) {
21961 let len = __tmp.len();
21962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21963 } else {
21964 __tmp.len()
21965 }
21966 }
21967}
21968#[doc = "id: 114"]
21969#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
21970#[derive(Debug, Clone, PartialEq)]
21971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21973pub struct HIL_OPTICAL_FLOW_DATA {
21974 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21975 pub time_usec: u64,
21976 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
21977 pub integration_time_us: u32,
21978 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
21979 pub integrated_x: f32,
21980 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
21981 pub integrated_y: f32,
21982 #[doc = "RH rotation around X axis"]
21983 pub integrated_xgyro: f32,
21984 #[doc = "RH rotation around Y axis"]
21985 pub integrated_ygyro: f32,
21986 #[doc = "RH rotation around Z axis"]
21987 pub integrated_zgyro: f32,
21988 #[doc = "Time since the distance was sampled."]
21989 pub time_delta_distance_us: u32,
21990 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
21991 pub distance: f32,
21992 #[doc = "Temperature"]
21993 pub temperature: i16,
21994 #[doc = "Sensor ID"]
21995 pub sensor_id: u8,
21996 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
21997 pub quality: u8,
21998}
21999impl HIL_OPTICAL_FLOW_DATA {
22000 pub const ENCODED_LEN: usize = 44usize;
22001 pub const DEFAULT: Self = Self {
22002 time_usec: 0_u64,
22003 integration_time_us: 0_u32,
22004 integrated_x: 0.0_f32,
22005 integrated_y: 0.0_f32,
22006 integrated_xgyro: 0.0_f32,
22007 integrated_ygyro: 0.0_f32,
22008 integrated_zgyro: 0.0_f32,
22009 time_delta_distance_us: 0_u32,
22010 distance: 0.0_f32,
22011 temperature: 0_i16,
22012 sensor_id: 0_u8,
22013 quality: 0_u8,
22014 };
22015 #[cfg(feature = "arbitrary")]
22016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22017 use arbitrary::{Arbitrary, Unstructured};
22018 let mut buf = [0u8; 1024];
22019 rng.fill_bytes(&mut buf);
22020 let mut unstructured = Unstructured::new(&buf);
22021 Self::arbitrary(&mut unstructured).unwrap_or_default()
22022 }
22023}
22024impl Default for HIL_OPTICAL_FLOW_DATA {
22025 fn default() -> Self {
22026 Self::DEFAULT.clone()
22027 }
22028}
22029impl MessageData for HIL_OPTICAL_FLOW_DATA {
22030 type Message = MavMessage;
22031 const ID: u32 = 114u32;
22032 const NAME: &'static str = "HIL_OPTICAL_FLOW";
22033 const EXTRA_CRC: u8 = 237u8;
22034 const ENCODED_LEN: usize = 44usize;
22035 fn deser(
22036 _version: MavlinkVersion,
22037 __input: &[u8],
22038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22039 let avail_len = __input.len();
22040 let mut payload_buf = [0; Self::ENCODED_LEN];
22041 let mut buf = if avail_len < Self::ENCODED_LEN {
22042 payload_buf[0..avail_len].copy_from_slice(__input);
22043 Bytes::new(&payload_buf)
22044 } else {
22045 Bytes::new(__input)
22046 };
22047 let mut __struct = Self::default();
22048 __struct.time_usec = buf.get_u64_le();
22049 __struct.integration_time_us = buf.get_u32_le();
22050 __struct.integrated_x = buf.get_f32_le();
22051 __struct.integrated_y = buf.get_f32_le();
22052 __struct.integrated_xgyro = buf.get_f32_le();
22053 __struct.integrated_ygyro = buf.get_f32_le();
22054 __struct.integrated_zgyro = buf.get_f32_le();
22055 __struct.time_delta_distance_us = buf.get_u32_le();
22056 __struct.distance = buf.get_f32_le();
22057 __struct.temperature = buf.get_i16_le();
22058 __struct.sensor_id = buf.get_u8();
22059 __struct.quality = buf.get_u8();
22060 Ok(__struct)
22061 }
22062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22063 let mut __tmp = BytesMut::new(bytes);
22064 #[allow(clippy::absurd_extreme_comparisons)]
22065 #[allow(unused_comparisons)]
22066 if __tmp.remaining() < Self::ENCODED_LEN {
22067 panic!(
22068 "buffer is too small (need {} bytes, but got {})",
22069 Self::ENCODED_LEN,
22070 __tmp.remaining(),
22071 )
22072 }
22073 __tmp.put_u64_le(self.time_usec);
22074 __tmp.put_u32_le(self.integration_time_us);
22075 __tmp.put_f32_le(self.integrated_x);
22076 __tmp.put_f32_le(self.integrated_y);
22077 __tmp.put_f32_le(self.integrated_xgyro);
22078 __tmp.put_f32_le(self.integrated_ygyro);
22079 __tmp.put_f32_le(self.integrated_zgyro);
22080 __tmp.put_u32_le(self.time_delta_distance_us);
22081 __tmp.put_f32_le(self.distance);
22082 __tmp.put_i16_le(self.temperature);
22083 __tmp.put_u8(self.sensor_id);
22084 __tmp.put_u8(self.quality);
22085 if matches!(version, MavlinkVersion::V2) {
22086 let len = __tmp.len();
22087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22088 } else {
22089 __tmp.len()
22090 }
22091 }
22092}
22093#[doc = "id: 92"]
22094#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
22095#[derive(Debug, Clone, PartialEq)]
22096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22098pub struct HIL_RC_INPUTS_RAW_DATA {
22099 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22100 pub time_usec: u64,
22101 #[doc = "RC channel 1 value"]
22102 pub chan1_raw: u16,
22103 #[doc = "RC channel 2 value"]
22104 pub chan2_raw: u16,
22105 #[doc = "RC channel 3 value"]
22106 pub chan3_raw: u16,
22107 #[doc = "RC channel 4 value"]
22108 pub chan4_raw: u16,
22109 #[doc = "RC channel 5 value"]
22110 pub chan5_raw: u16,
22111 #[doc = "RC channel 6 value"]
22112 pub chan6_raw: u16,
22113 #[doc = "RC channel 7 value"]
22114 pub chan7_raw: u16,
22115 #[doc = "RC channel 8 value"]
22116 pub chan8_raw: u16,
22117 #[doc = "RC channel 9 value"]
22118 pub chan9_raw: u16,
22119 #[doc = "RC channel 10 value"]
22120 pub chan10_raw: u16,
22121 #[doc = "RC channel 11 value"]
22122 pub chan11_raw: u16,
22123 #[doc = "RC channel 12 value"]
22124 pub chan12_raw: u16,
22125 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
22126 pub rssi: u8,
22127}
22128impl HIL_RC_INPUTS_RAW_DATA {
22129 pub const ENCODED_LEN: usize = 33usize;
22130 pub const DEFAULT: Self = Self {
22131 time_usec: 0_u64,
22132 chan1_raw: 0_u16,
22133 chan2_raw: 0_u16,
22134 chan3_raw: 0_u16,
22135 chan4_raw: 0_u16,
22136 chan5_raw: 0_u16,
22137 chan6_raw: 0_u16,
22138 chan7_raw: 0_u16,
22139 chan8_raw: 0_u16,
22140 chan9_raw: 0_u16,
22141 chan10_raw: 0_u16,
22142 chan11_raw: 0_u16,
22143 chan12_raw: 0_u16,
22144 rssi: 0_u8,
22145 };
22146 #[cfg(feature = "arbitrary")]
22147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22148 use arbitrary::{Arbitrary, Unstructured};
22149 let mut buf = [0u8; 1024];
22150 rng.fill_bytes(&mut buf);
22151 let mut unstructured = Unstructured::new(&buf);
22152 Self::arbitrary(&mut unstructured).unwrap_or_default()
22153 }
22154}
22155impl Default for HIL_RC_INPUTS_RAW_DATA {
22156 fn default() -> Self {
22157 Self::DEFAULT.clone()
22158 }
22159}
22160impl MessageData for HIL_RC_INPUTS_RAW_DATA {
22161 type Message = MavMessage;
22162 const ID: u32 = 92u32;
22163 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
22164 const EXTRA_CRC: u8 = 54u8;
22165 const ENCODED_LEN: usize = 33usize;
22166 fn deser(
22167 _version: MavlinkVersion,
22168 __input: &[u8],
22169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22170 let avail_len = __input.len();
22171 let mut payload_buf = [0; Self::ENCODED_LEN];
22172 let mut buf = if avail_len < Self::ENCODED_LEN {
22173 payload_buf[0..avail_len].copy_from_slice(__input);
22174 Bytes::new(&payload_buf)
22175 } else {
22176 Bytes::new(__input)
22177 };
22178 let mut __struct = Self::default();
22179 __struct.time_usec = buf.get_u64_le();
22180 __struct.chan1_raw = buf.get_u16_le();
22181 __struct.chan2_raw = buf.get_u16_le();
22182 __struct.chan3_raw = buf.get_u16_le();
22183 __struct.chan4_raw = buf.get_u16_le();
22184 __struct.chan5_raw = buf.get_u16_le();
22185 __struct.chan6_raw = buf.get_u16_le();
22186 __struct.chan7_raw = buf.get_u16_le();
22187 __struct.chan8_raw = buf.get_u16_le();
22188 __struct.chan9_raw = buf.get_u16_le();
22189 __struct.chan10_raw = buf.get_u16_le();
22190 __struct.chan11_raw = buf.get_u16_le();
22191 __struct.chan12_raw = buf.get_u16_le();
22192 __struct.rssi = buf.get_u8();
22193 Ok(__struct)
22194 }
22195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22196 let mut __tmp = BytesMut::new(bytes);
22197 #[allow(clippy::absurd_extreme_comparisons)]
22198 #[allow(unused_comparisons)]
22199 if __tmp.remaining() < Self::ENCODED_LEN {
22200 panic!(
22201 "buffer is too small (need {} bytes, but got {})",
22202 Self::ENCODED_LEN,
22203 __tmp.remaining(),
22204 )
22205 }
22206 __tmp.put_u64_le(self.time_usec);
22207 __tmp.put_u16_le(self.chan1_raw);
22208 __tmp.put_u16_le(self.chan2_raw);
22209 __tmp.put_u16_le(self.chan3_raw);
22210 __tmp.put_u16_le(self.chan4_raw);
22211 __tmp.put_u16_le(self.chan5_raw);
22212 __tmp.put_u16_le(self.chan6_raw);
22213 __tmp.put_u16_le(self.chan7_raw);
22214 __tmp.put_u16_le(self.chan8_raw);
22215 __tmp.put_u16_le(self.chan9_raw);
22216 __tmp.put_u16_le(self.chan10_raw);
22217 __tmp.put_u16_le(self.chan11_raw);
22218 __tmp.put_u16_le(self.chan12_raw);
22219 __tmp.put_u8(self.rssi);
22220 if matches!(version, MavlinkVersion::V2) {
22221 let len = __tmp.len();
22222 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22223 } else {
22224 __tmp.len()
22225 }
22226 }
22227}
22228#[doc = "id: 107"]
22229#[doc = "The IMU readings in SI units in NED body frame."]
22230#[derive(Debug, Clone, PartialEq)]
22231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22233pub struct HIL_SENSOR_DATA {
22234 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22235 pub time_usec: u64,
22236 #[doc = "X acceleration"]
22237 pub xacc: f32,
22238 #[doc = "Y acceleration"]
22239 pub yacc: f32,
22240 #[doc = "Z acceleration"]
22241 pub zacc: f32,
22242 #[doc = "Angular speed around X axis in body frame"]
22243 pub xgyro: f32,
22244 #[doc = "Angular speed around Y axis in body frame"]
22245 pub ygyro: f32,
22246 #[doc = "Angular speed around Z axis in body frame"]
22247 pub zgyro: f32,
22248 #[doc = "X Magnetic field"]
22249 pub xmag: f32,
22250 #[doc = "Y Magnetic field"]
22251 pub ymag: f32,
22252 #[doc = "Z Magnetic field"]
22253 pub zmag: f32,
22254 #[doc = "Absolute pressure"]
22255 pub abs_pressure: f32,
22256 #[doc = "Differential pressure (airspeed)"]
22257 pub diff_pressure: f32,
22258 #[doc = "Altitude calculated from pressure"]
22259 pub pressure_alt: f32,
22260 #[doc = "Temperature"]
22261 pub temperature: f32,
22262 #[doc = "Bitmap for fields that have updated since last message"]
22263 pub fields_updated: HilSensorUpdatedFlags,
22264 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
22265 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22266 pub id: u8,
22267}
22268impl HIL_SENSOR_DATA {
22269 pub const ENCODED_LEN: usize = 65usize;
22270 pub const DEFAULT: Self = Self {
22271 time_usec: 0_u64,
22272 xacc: 0.0_f32,
22273 yacc: 0.0_f32,
22274 zacc: 0.0_f32,
22275 xgyro: 0.0_f32,
22276 ygyro: 0.0_f32,
22277 zgyro: 0.0_f32,
22278 xmag: 0.0_f32,
22279 ymag: 0.0_f32,
22280 zmag: 0.0_f32,
22281 abs_pressure: 0.0_f32,
22282 diff_pressure: 0.0_f32,
22283 pressure_alt: 0.0_f32,
22284 temperature: 0.0_f32,
22285 fields_updated: HilSensorUpdatedFlags::DEFAULT,
22286 id: 0_u8,
22287 };
22288 #[cfg(feature = "arbitrary")]
22289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22290 use arbitrary::{Arbitrary, Unstructured};
22291 let mut buf = [0u8; 1024];
22292 rng.fill_bytes(&mut buf);
22293 let mut unstructured = Unstructured::new(&buf);
22294 Self::arbitrary(&mut unstructured).unwrap_or_default()
22295 }
22296}
22297impl Default for HIL_SENSOR_DATA {
22298 fn default() -> Self {
22299 Self::DEFAULT.clone()
22300 }
22301}
22302impl MessageData for HIL_SENSOR_DATA {
22303 type Message = MavMessage;
22304 const ID: u32 = 107u32;
22305 const NAME: &'static str = "HIL_SENSOR";
22306 const EXTRA_CRC: u8 = 108u8;
22307 const ENCODED_LEN: usize = 65usize;
22308 fn deser(
22309 _version: MavlinkVersion,
22310 __input: &[u8],
22311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22312 let avail_len = __input.len();
22313 let mut payload_buf = [0; Self::ENCODED_LEN];
22314 let mut buf = if avail_len < Self::ENCODED_LEN {
22315 payload_buf[0..avail_len].copy_from_slice(__input);
22316 Bytes::new(&payload_buf)
22317 } else {
22318 Bytes::new(__input)
22319 };
22320 let mut __struct = Self::default();
22321 __struct.time_usec = buf.get_u64_le();
22322 __struct.xacc = buf.get_f32_le();
22323 __struct.yacc = buf.get_f32_le();
22324 __struct.zacc = buf.get_f32_le();
22325 __struct.xgyro = buf.get_f32_le();
22326 __struct.ygyro = buf.get_f32_le();
22327 __struct.zgyro = buf.get_f32_le();
22328 __struct.xmag = buf.get_f32_le();
22329 __struct.ymag = buf.get_f32_le();
22330 __struct.zmag = buf.get_f32_le();
22331 __struct.abs_pressure = buf.get_f32_le();
22332 __struct.diff_pressure = buf.get_f32_le();
22333 __struct.pressure_alt = buf.get_f32_le();
22334 __struct.temperature = buf.get_f32_le();
22335 let tmp = buf.get_u32_le();
22336 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
22337 tmp & HilSensorUpdatedFlags::all().bits(),
22338 )
22339 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
22340 flag_type: "HilSensorUpdatedFlags",
22341 value: tmp as u32,
22342 })?;
22343 __struct.id = buf.get_u8();
22344 Ok(__struct)
22345 }
22346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22347 let mut __tmp = BytesMut::new(bytes);
22348 #[allow(clippy::absurd_extreme_comparisons)]
22349 #[allow(unused_comparisons)]
22350 if __tmp.remaining() < Self::ENCODED_LEN {
22351 panic!(
22352 "buffer is too small (need {} bytes, but got {})",
22353 Self::ENCODED_LEN,
22354 __tmp.remaining(),
22355 )
22356 }
22357 __tmp.put_u64_le(self.time_usec);
22358 __tmp.put_f32_le(self.xacc);
22359 __tmp.put_f32_le(self.yacc);
22360 __tmp.put_f32_le(self.zacc);
22361 __tmp.put_f32_le(self.xgyro);
22362 __tmp.put_f32_le(self.ygyro);
22363 __tmp.put_f32_le(self.zgyro);
22364 __tmp.put_f32_le(self.xmag);
22365 __tmp.put_f32_le(self.ymag);
22366 __tmp.put_f32_le(self.zmag);
22367 __tmp.put_f32_le(self.abs_pressure);
22368 __tmp.put_f32_le(self.diff_pressure);
22369 __tmp.put_f32_le(self.pressure_alt);
22370 __tmp.put_f32_le(self.temperature);
22371 __tmp.put_u32_le(self.fields_updated.bits());
22372 __tmp.put_u8(self.id);
22373 if matches!(version, MavlinkVersion::V2) {
22374 let len = __tmp.len();
22375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22376 } else {
22377 __tmp.len()
22378 }
22379 }
22380}
22381#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
22382#[doc = "id: 90"]
22383#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
22384#[derive(Debug, Clone, PartialEq)]
22385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22387pub struct HIL_STATE_DATA {
22388 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22389 pub time_usec: u64,
22390 #[doc = "Roll angle"]
22391 pub roll: f32,
22392 #[doc = "Pitch angle"]
22393 pub pitch: f32,
22394 #[doc = "Yaw angle"]
22395 pub yaw: f32,
22396 #[doc = "Body frame roll / phi angular speed"]
22397 pub rollspeed: f32,
22398 #[doc = "Body frame pitch / theta angular speed"]
22399 pub pitchspeed: f32,
22400 #[doc = "Body frame yaw / psi angular speed"]
22401 pub yawspeed: f32,
22402 #[doc = "Latitude"]
22403 pub lat: i32,
22404 #[doc = "Longitude"]
22405 pub lon: i32,
22406 #[doc = "Altitude"]
22407 pub alt: i32,
22408 #[doc = "Ground X Speed (Latitude)"]
22409 pub vx: i16,
22410 #[doc = "Ground Y Speed (Longitude)"]
22411 pub vy: i16,
22412 #[doc = "Ground Z Speed (Altitude)"]
22413 pub vz: i16,
22414 #[doc = "X acceleration"]
22415 pub xacc: i16,
22416 #[doc = "Y acceleration"]
22417 pub yacc: i16,
22418 #[doc = "Z acceleration"]
22419 pub zacc: i16,
22420}
22421impl HIL_STATE_DATA {
22422 pub const ENCODED_LEN: usize = 56usize;
22423 pub const DEFAULT: Self = Self {
22424 time_usec: 0_u64,
22425 roll: 0.0_f32,
22426 pitch: 0.0_f32,
22427 yaw: 0.0_f32,
22428 rollspeed: 0.0_f32,
22429 pitchspeed: 0.0_f32,
22430 yawspeed: 0.0_f32,
22431 lat: 0_i32,
22432 lon: 0_i32,
22433 alt: 0_i32,
22434 vx: 0_i16,
22435 vy: 0_i16,
22436 vz: 0_i16,
22437 xacc: 0_i16,
22438 yacc: 0_i16,
22439 zacc: 0_i16,
22440 };
22441 #[cfg(feature = "arbitrary")]
22442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22443 use arbitrary::{Arbitrary, Unstructured};
22444 let mut buf = [0u8; 1024];
22445 rng.fill_bytes(&mut buf);
22446 let mut unstructured = Unstructured::new(&buf);
22447 Self::arbitrary(&mut unstructured).unwrap_or_default()
22448 }
22449}
22450impl Default for HIL_STATE_DATA {
22451 fn default() -> Self {
22452 Self::DEFAULT.clone()
22453 }
22454}
22455impl MessageData for HIL_STATE_DATA {
22456 type Message = MavMessage;
22457 const ID: u32 = 90u32;
22458 const NAME: &'static str = "HIL_STATE";
22459 const EXTRA_CRC: u8 = 183u8;
22460 const ENCODED_LEN: usize = 56usize;
22461 fn deser(
22462 _version: MavlinkVersion,
22463 __input: &[u8],
22464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22465 let avail_len = __input.len();
22466 let mut payload_buf = [0; Self::ENCODED_LEN];
22467 let mut buf = if avail_len < Self::ENCODED_LEN {
22468 payload_buf[0..avail_len].copy_from_slice(__input);
22469 Bytes::new(&payload_buf)
22470 } else {
22471 Bytes::new(__input)
22472 };
22473 let mut __struct = Self::default();
22474 __struct.time_usec = buf.get_u64_le();
22475 __struct.roll = buf.get_f32_le();
22476 __struct.pitch = buf.get_f32_le();
22477 __struct.yaw = buf.get_f32_le();
22478 __struct.rollspeed = buf.get_f32_le();
22479 __struct.pitchspeed = buf.get_f32_le();
22480 __struct.yawspeed = buf.get_f32_le();
22481 __struct.lat = buf.get_i32_le();
22482 __struct.lon = buf.get_i32_le();
22483 __struct.alt = buf.get_i32_le();
22484 __struct.vx = buf.get_i16_le();
22485 __struct.vy = buf.get_i16_le();
22486 __struct.vz = buf.get_i16_le();
22487 __struct.xacc = buf.get_i16_le();
22488 __struct.yacc = buf.get_i16_le();
22489 __struct.zacc = buf.get_i16_le();
22490 Ok(__struct)
22491 }
22492 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22493 let mut __tmp = BytesMut::new(bytes);
22494 #[allow(clippy::absurd_extreme_comparisons)]
22495 #[allow(unused_comparisons)]
22496 if __tmp.remaining() < Self::ENCODED_LEN {
22497 panic!(
22498 "buffer is too small (need {} bytes, but got {})",
22499 Self::ENCODED_LEN,
22500 __tmp.remaining(),
22501 )
22502 }
22503 __tmp.put_u64_le(self.time_usec);
22504 __tmp.put_f32_le(self.roll);
22505 __tmp.put_f32_le(self.pitch);
22506 __tmp.put_f32_le(self.yaw);
22507 __tmp.put_f32_le(self.rollspeed);
22508 __tmp.put_f32_le(self.pitchspeed);
22509 __tmp.put_f32_le(self.yawspeed);
22510 __tmp.put_i32_le(self.lat);
22511 __tmp.put_i32_le(self.lon);
22512 __tmp.put_i32_le(self.alt);
22513 __tmp.put_i16_le(self.vx);
22514 __tmp.put_i16_le(self.vy);
22515 __tmp.put_i16_le(self.vz);
22516 __tmp.put_i16_le(self.xacc);
22517 __tmp.put_i16_le(self.yacc);
22518 __tmp.put_i16_le(self.zacc);
22519 if matches!(version, MavlinkVersion::V2) {
22520 let len = __tmp.len();
22521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22522 } else {
22523 __tmp.len()
22524 }
22525 }
22526}
22527#[doc = "id: 115"]
22528#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
22529#[derive(Debug, Clone, PartialEq)]
22530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22532pub struct HIL_STATE_QUATERNION_DATA {
22533 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22534 pub time_usec: u64,
22535 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
22536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22537 pub attitude_quaternion: [f32; 4],
22538 #[doc = "Body frame roll / phi angular speed"]
22539 pub rollspeed: f32,
22540 #[doc = "Body frame pitch / theta angular speed"]
22541 pub pitchspeed: f32,
22542 #[doc = "Body frame yaw / psi angular speed"]
22543 pub yawspeed: f32,
22544 #[doc = "Latitude"]
22545 pub lat: i32,
22546 #[doc = "Longitude"]
22547 pub lon: i32,
22548 #[doc = "Altitude"]
22549 pub alt: i32,
22550 #[doc = "Ground X Speed (Latitude)"]
22551 pub vx: i16,
22552 #[doc = "Ground Y Speed (Longitude)"]
22553 pub vy: i16,
22554 #[doc = "Ground Z Speed (Altitude)"]
22555 pub vz: i16,
22556 #[doc = "Indicated airspeed"]
22557 pub ind_airspeed: u16,
22558 #[doc = "True airspeed"]
22559 pub true_airspeed: u16,
22560 #[doc = "X acceleration"]
22561 pub xacc: i16,
22562 #[doc = "Y acceleration"]
22563 pub yacc: i16,
22564 #[doc = "Z acceleration"]
22565 pub zacc: i16,
22566}
22567impl HIL_STATE_QUATERNION_DATA {
22568 pub const ENCODED_LEN: usize = 64usize;
22569 pub const DEFAULT: Self = Self {
22570 time_usec: 0_u64,
22571 attitude_quaternion: [0.0_f32; 4usize],
22572 rollspeed: 0.0_f32,
22573 pitchspeed: 0.0_f32,
22574 yawspeed: 0.0_f32,
22575 lat: 0_i32,
22576 lon: 0_i32,
22577 alt: 0_i32,
22578 vx: 0_i16,
22579 vy: 0_i16,
22580 vz: 0_i16,
22581 ind_airspeed: 0_u16,
22582 true_airspeed: 0_u16,
22583 xacc: 0_i16,
22584 yacc: 0_i16,
22585 zacc: 0_i16,
22586 };
22587 #[cfg(feature = "arbitrary")]
22588 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22589 use arbitrary::{Arbitrary, Unstructured};
22590 let mut buf = [0u8; 1024];
22591 rng.fill_bytes(&mut buf);
22592 let mut unstructured = Unstructured::new(&buf);
22593 Self::arbitrary(&mut unstructured).unwrap_or_default()
22594 }
22595}
22596impl Default for HIL_STATE_QUATERNION_DATA {
22597 fn default() -> Self {
22598 Self::DEFAULT.clone()
22599 }
22600}
22601impl MessageData for HIL_STATE_QUATERNION_DATA {
22602 type Message = MavMessage;
22603 const ID: u32 = 115u32;
22604 const NAME: &'static str = "HIL_STATE_QUATERNION";
22605 const EXTRA_CRC: u8 = 4u8;
22606 const ENCODED_LEN: usize = 64usize;
22607 fn deser(
22608 _version: MavlinkVersion,
22609 __input: &[u8],
22610 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22611 let avail_len = __input.len();
22612 let mut payload_buf = [0; Self::ENCODED_LEN];
22613 let mut buf = if avail_len < Self::ENCODED_LEN {
22614 payload_buf[0..avail_len].copy_from_slice(__input);
22615 Bytes::new(&payload_buf)
22616 } else {
22617 Bytes::new(__input)
22618 };
22619 let mut __struct = Self::default();
22620 __struct.time_usec = buf.get_u64_le();
22621 for v in &mut __struct.attitude_quaternion {
22622 let val = buf.get_f32_le();
22623 *v = val;
22624 }
22625 __struct.rollspeed = buf.get_f32_le();
22626 __struct.pitchspeed = buf.get_f32_le();
22627 __struct.yawspeed = buf.get_f32_le();
22628 __struct.lat = buf.get_i32_le();
22629 __struct.lon = buf.get_i32_le();
22630 __struct.alt = buf.get_i32_le();
22631 __struct.vx = buf.get_i16_le();
22632 __struct.vy = buf.get_i16_le();
22633 __struct.vz = buf.get_i16_le();
22634 __struct.ind_airspeed = buf.get_u16_le();
22635 __struct.true_airspeed = buf.get_u16_le();
22636 __struct.xacc = buf.get_i16_le();
22637 __struct.yacc = buf.get_i16_le();
22638 __struct.zacc = buf.get_i16_le();
22639 Ok(__struct)
22640 }
22641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22642 let mut __tmp = BytesMut::new(bytes);
22643 #[allow(clippy::absurd_extreme_comparisons)]
22644 #[allow(unused_comparisons)]
22645 if __tmp.remaining() < Self::ENCODED_LEN {
22646 panic!(
22647 "buffer is too small (need {} bytes, but got {})",
22648 Self::ENCODED_LEN,
22649 __tmp.remaining(),
22650 )
22651 }
22652 __tmp.put_u64_le(self.time_usec);
22653 for val in &self.attitude_quaternion {
22654 __tmp.put_f32_le(*val);
22655 }
22656 __tmp.put_f32_le(self.rollspeed);
22657 __tmp.put_f32_le(self.pitchspeed);
22658 __tmp.put_f32_le(self.yawspeed);
22659 __tmp.put_i32_le(self.lat);
22660 __tmp.put_i32_le(self.lon);
22661 __tmp.put_i32_le(self.alt);
22662 __tmp.put_i16_le(self.vx);
22663 __tmp.put_i16_le(self.vy);
22664 __tmp.put_i16_le(self.vz);
22665 __tmp.put_u16_le(self.ind_airspeed);
22666 __tmp.put_u16_le(self.true_airspeed);
22667 __tmp.put_i16_le(self.xacc);
22668 __tmp.put_i16_le(self.yacc);
22669 __tmp.put_i16_le(self.zacc);
22670 if matches!(version, MavlinkVersion::V2) {
22671 let len = __tmp.len();
22672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22673 } else {
22674 __tmp.len()
22675 }
22676 }
22677}
22678#[doc = "id: 242"]
22679#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
22680#[derive(Debug, Clone, PartialEq)]
22681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22683pub struct HOME_POSITION_DATA {
22684 #[doc = "Latitude (WGS84)"]
22685 pub latitude: i32,
22686 #[doc = "Longitude (WGS84)"]
22687 pub longitude: i32,
22688 #[doc = "Altitude (MSL). Positive for up."]
22689 pub altitude: i32,
22690 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
22691 pub x: f32,
22692 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
22693 pub y: f32,
22694 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
22695 pub z: f32,
22696 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
22697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22698 pub q: [f32; 4],
22699 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
22700 pub approach_x: f32,
22701 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
22702 pub approach_y: f32,
22703 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
22704 pub approach_z: f32,
22705 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22707 pub time_usec: u64,
22708}
22709impl HOME_POSITION_DATA {
22710 pub const ENCODED_LEN: usize = 60usize;
22711 pub const DEFAULT: Self = Self {
22712 latitude: 0_i32,
22713 longitude: 0_i32,
22714 altitude: 0_i32,
22715 x: 0.0_f32,
22716 y: 0.0_f32,
22717 z: 0.0_f32,
22718 q: [0.0_f32; 4usize],
22719 approach_x: 0.0_f32,
22720 approach_y: 0.0_f32,
22721 approach_z: 0.0_f32,
22722 time_usec: 0_u64,
22723 };
22724 #[cfg(feature = "arbitrary")]
22725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22726 use arbitrary::{Arbitrary, Unstructured};
22727 let mut buf = [0u8; 1024];
22728 rng.fill_bytes(&mut buf);
22729 let mut unstructured = Unstructured::new(&buf);
22730 Self::arbitrary(&mut unstructured).unwrap_or_default()
22731 }
22732}
22733impl Default for HOME_POSITION_DATA {
22734 fn default() -> Self {
22735 Self::DEFAULT.clone()
22736 }
22737}
22738impl MessageData for HOME_POSITION_DATA {
22739 type Message = MavMessage;
22740 const ID: u32 = 242u32;
22741 const NAME: &'static str = "HOME_POSITION";
22742 const EXTRA_CRC: u8 = 104u8;
22743 const ENCODED_LEN: usize = 60usize;
22744 fn deser(
22745 _version: MavlinkVersion,
22746 __input: &[u8],
22747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22748 let avail_len = __input.len();
22749 let mut payload_buf = [0; Self::ENCODED_LEN];
22750 let mut buf = if avail_len < Self::ENCODED_LEN {
22751 payload_buf[0..avail_len].copy_from_slice(__input);
22752 Bytes::new(&payload_buf)
22753 } else {
22754 Bytes::new(__input)
22755 };
22756 let mut __struct = Self::default();
22757 __struct.latitude = buf.get_i32_le();
22758 __struct.longitude = buf.get_i32_le();
22759 __struct.altitude = buf.get_i32_le();
22760 __struct.x = buf.get_f32_le();
22761 __struct.y = buf.get_f32_le();
22762 __struct.z = buf.get_f32_le();
22763 for v in &mut __struct.q {
22764 let val = buf.get_f32_le();
22765 *v = val;
22766 }
22767 __struct.approach_x = buf.get_f32_le();
22768 __struct.approach_y = buf.get_f32_le();
22769 __struct.approach_z = buf.get_f32_le();
22770 __struct.time_usec = buf.get_u64_le();
22771 Ok(__struct)
22772 }
22773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22774 let mut __tmp = BytesMut::new(bytes);
22775 #[allow(clippy::absurd_extreme_comparisons)]
22776 #[allow(unused_comparisons)]
22777 if __tmp.remaining() < Self::ENCODED_LEN {
22778 panic!(
22779 "buffer is too small (need {} bytes, but got {})",
22780 Self::ENCODED_LEN,
22781 __tmp.remaining(),
22782 )
22783 }
22784 __tmp.put_i32_le(self.latitude);
22785 __tmp.put_i32_le(self.longitude);
22786 __tmp.put_i32_le(self.altitude);
22787 __tmp.put_f32_le(self.x);
22788 __tmp.put_f32_le(self.y);
22789 __tmp.put_f32_le(self.z);
22790 for val in &self.q {
22791 __tmp.put_f32_le(*val);
22792 }
22793 __tmp.put_f32_le(self.approach_x);
22794 __tmp.put_f32_le(self.approach_y);
22795 __tmp.put_f32_le(self.approach_z);
22796 __tmp.put_u64_le(self.time_usec);
22797 if matches!(version, MavlinkVersion::V2) {
22798 let len = __tmp.len();
22799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22800 } else {
22801 __tmp.len()
22802 }
22803 }
22804}
22805#[doc = "id: 165"]
22806#[doc = "Status of key hardware."]
22807#[derive(Debug, Clone, PartialEq)]
22808#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22809#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22810pub struct HWSTATUS_DATA {
22811 #[doc = "Board voltage."]
22812 pub Vcc: u16,
22813 #[doc = "I2C error count."]
22814 pub I2Cerr: u8,
22815}
22816impl HWSTATUS_DATA {
22817 pub const ENCODED_LEN: usize = 3usize;
22818 pub const DEFAULT: Self = Self {
22819 Vcc: 0_u16,
22820 I2Cerr: 0_u8,
22821 };
22822 #[cfg(feature = "arbitrary")]
22823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22824 use arbitrary::{Arbitrary, Unstructured};
22825 let mut buf = [0u8; 1024];
22826 rng.fill_bytes(&mut buf);
22827 let mut unstructured = Unstructured::new(&buf);
22828 Self::arbitrary(&mut unstructured).unwrap_or_default()
22829 }
22830}
22831impl Default for HWSTATUS_DATA {
22832 fn default() -> Self {
22833 Self::DEFAULT.clone()
22834 }
22835}
22836impl MessageData for HWSTATUS_DATA {
22837 type Message = MavMessage;
22838 const ID: u32 = 165u32;
22839 const NAME: &'static str = "HWSTATUS";
22840 const EXTRA_CRC: u8 = 21u8;
22841 const ENCODED_LEN: usize = 3usize;
22842 fn deser(
22843 _version: MavlinkVersion,
22844 __input: &[u8],
22845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22846 let avail_len = __input.len();
22847 let mut payload_buf = [0; Self::ENCODED_LEN];
22848 let mut buf = if avail_len < Self::ENCODED_LEN {
22849 payload_buf[0..avail_len].copy_from_slice(__input);
22850 Bytes::new(&payload_buf)
22851 } else {
22852 Bytes::new(__input)
22853 };
22854 let mut __struct = Self::default();
22855 __struct.Vcc = buf.get_u16_le();
22856 __struct.I2Cerr = buf.get_u8();
22857 Ok(__struct)
22858 }
22859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22860 let mut __tmp = BytesMut::new(bytes);
22861 #[allow(clippy::absurd_extreme_comparisons)]
22862 #[allow(unused_comparisons)]
22863 if __tmp.remaining() < Self::ENCODED_LEN {
22864 panic!(
22865 "buffer is too small (need {} bytes, but got {})",
22866 Self::ENCODED_LEN,
22867 __tmp.remaining(),
22868 )
22869 }
22870 __tmp.put_u16_le(self.Vcc);
22871 __tmp.put_u8(self.I2Cerr);
22872 if matches!(version, MavlinkVersion::V2) {
22873 let len = __tmp.len();
22874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22875 } else {
22876 __tmp.len()
22877 }
22878 }
22879}
22880#[doc = "id: 12920"]
22881#[doc = "Temperature and humidity from hygrometer."]
22882#[derive(Debug, Clone, PartialEq)]
22883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22885pub struct HYGROMETER_SENSOR_DATA {
22886 #[doc = "Temperature"]
22887 pub temperature: i16,
22888 #[doc = "Humidity"]
22889 pub humidity: u16,
22890 #[doc = "Hygrometer ID"]
22891 pub id: u8,
22892}
22893impl HYGROMETER_SENSOR_DATA {
22894 pub const ENCODED_LEN: usize = 5usize;
22895 pub const DEFAULT: Self = Self {
22896 temperature: 0_i16,
22897 humidity: 0_u16,
22898 id: 0_u8,
22899 };
22900 #[cfg(feature = "arbitrary")]
22901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22902 use arbitrary::{Arbitrary, Unstructured};
22903 let mut buf = [0u8; 1024];
22904 rng.fill_bytes(&mut buf);
22905 let mut unstructured = Unstructured::new(&buf);
22906 Self::arbitrary(&mut unstructured).unwrap_or_default()
22907 }
22908}
22909impl Default for HYGROMETER_SENSOR_DATA {
22910 fn default() -> Self {
22911 Self::DEFAULT.clone()
22912 }
22913}
22914impl MessageData for HYGROMETER_SENSOR_DATA {
22915 type Message = MavMessage;
22916 const ID: u32 = 12920u32;
22917 const NAME: &'static str = "HYGROMETER_SENSOR";
22918 const EXTRA_CRC: u8 = 20u8;
22919 const ENCODED_LEN: usize = 5usize;
22920 fn deser(
22921 _version: MavlinkVersion,
22922 __input: &[u8],
22923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22924 let avail_len = __input.len();
22925 let mut payload_buf = [0; Self::ENCODED_LEN];
22926 let mut buf = if avail_len < Self::ENCODED_LEN {
22927 payload_buf[0..avail_len].copy_from_slice(__input);
22928 Bytes::new(&payload_buf)
22929 } else {
22930 Bytes::new(__input)
22931 };
22932 let mut __struct = Self::default();
22933 __struct.temperature = buf.get_i16_le();
22934 __struct.humidity = buf.get_u16_le();
22935 __struct.id = buf.get_u8();
22936 Ok(__struct)
22937 }
22938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22939 let mut __tmp = BytesMut::new(bytes);
22940 #[allow(clippy::absurd_extreme_comparisons)]
22941 #[allow(unused_comparisons)]
22942 if __tmp.remaining() < Self::ENCODED_LEN {
22943 panic!(
22944 "buffer is too small (need {} bytes, but got {})",
22945 Self::ENCODED_LEN,
22946 __tmp.remaining(),
22947 )
22948 }
22949 __tmp.put_i16_le(self.temperature);
22950 __tmp.put_u16_le(self.humidity);
22951 __tmp.put_u8(self.id);
22952 if matches!(version, MavlinkVersion::V2) {
22953 let len = __tmp.len();
22954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22955 } else {
22956 __tmp.len()
22957 }
22958 }
22959}
22960#[doc = "id: 42000"]
22961#[doc = "ICAROUS heartbeat."]
22962#[derive(Debug, Clone, PartialEq)]
22963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22965pub struct ICAROUS_HEARTBEAT_DATA {
22966 #[doc = "See the FMS_STATE enum."]
22967 pub status: IcarousFmsState,
22968}
22969impl ICAROUS_HEARTBEAT_DATA {
22970 pub const ENCODED_LEN: usize = 1usize;
22971 pub const DEFAULT: Self = Self {
22972 status: IcarousFmsState::DEFAULT,
22973 };
22974 #[cfg(feature = "arbitrary")]
22975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22976 use arbitrary::{Arbitrary, Unstructured};
22977 let mut buf = [0u8; 1024];
22978 rng.fill_bytes(&mut buf);
22979 let mut unstructured = Unstructured::new(&buf);
22980 Self::arbitrary(&mut unstructured).unwrap_or_default()
22981 }
22982}
22983impl Default for ICAROUS_HEARTBEAT_DATA {
22984 fn default() -> Self {
22985 Self::DEFAULT.clone()
22986 }
22987}
22988impl MessageData for ICAROUS_HEARTBEAT_DATA {
22989 type Message = MavMessage;
22990 const ID: u32 = 42000u32;
22991 const NAME: &'static str = "ICAROUS_HEARTBEAT";
22992 const EXTRA_CRC: u8 = 227u8;
22993 const ENCODED_LEN: usize = 1usize;
22994 fn deser(
22995 _version: MavlinkVersion,
22996 __input: &[u8],
22997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22998 let avail_len = __input.len();
22999 let mut payload_buf = [0; Self::ENCODED_LEN];
23000 let mut buf = if avail_len < Self::ENCODED_LEN {
23001 payload_buf[0..avail_len].copy_from_slice(__input);
23002 Bytes::new(&payload_buf)
23003 } else {
23004 Bytes::new(__input)
23005 };
23006 let mut __struct = Self::default();
23007 let tmp = buf.get_u8();
23008 __struct.status =
23009 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23010 enum_type: "IcarousFmsState",
23011 value: tmp as u32,
23012 })?;
23013 Ok(__struct)
23014 }
23015 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23016 let mut __tmp = BytesMut::new(bytes);
23017 #[allow(clippy::absurd_extreme_comparisons)]
23018 #[allow(unused_comparisons)]
23019 if __tmp.remaining() < Self::ENCODED_LEN {
23020 panic!(
23021 "buffer is too small (need {} bytes, but got {})",
23022 Self::ENCODED_LEN,
23023 __tmp.remaining(),
23024 )
23025 }
23026 __tmp.put_u8(self.status as u8);
23027 if matches!(version, MavlinkVersion::V2) {
23028 let len = __tmp.len();
23029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23030 } else {
23031 __tmp.len()
23032 }
23033 }
23034}
23035#[doc = "id: 42001"]
23036#[doc = "Kinematic multi bands (track) output from Daidalus."]
23037#[derive(Debug, Clone, PartialEq)]
23038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23040pub struct ICAROUS_KINEMATIC_BANDS_DATA {
23041 #[doc = "min angle (degrees)"]
23042 pub min1: f32,
23043 #[doc = "max angle (degrees)"]
23044 pub max1: f32,
23045 #[doc = "min angle (degrees)"]
23046 pub min2: f32,
23047 #[doc = "max angle (degrees)"]
23048 pub max2: f32,
23049 #[doc = "min angle (degrees)"]
23050 pub min3: f32,
23051 #[doc = "max angle (degrees)"]
23052 pub max3: f32,
23053 #[doc = "min angle (degrees)"]
23054 pub min4: f32,
23055 #[doc = "max angle (degrees)"]
23056 pub max4: f32,
23057 #[doc = "min angle (degrees)"]
23058 pub min5: f32,
23059 #[doc = "max angle (degrees)"]
23060 pub max5: f32,
23061 #[doc = "Number of track bands"]
23062 pub numBands: i8,
23063 #[doc = "See the TRACK_BAND_TYPES enum."]
23064 pub type1: IcarousTrackBandTypes,
23065 #[doc = "See the TRACK_BAND_TYPES enum."]
23066 pub type2: IcarousTrackBandTypes,
23067 #[doc = "See the TRACK_BAND_TYPES enum."]
23068 pub type3: IcarousTrackBandTypes,
23069 #[doc = "See the TRACK_BAND_TYPES enum."]
23070 pub type4: IcarousTrackBandTypes,
23071 #[doc = "See the TRACK_BAND_TYPES enum."]
23072 pub type5: IcarousTrackBandTypes,
23073}
23074impl ICAROUS_KINEMATIC_BANDS_DATA {
23075 pub const ENCODED_LEN: usize = 46usize;
23076 pub const DEFAULT: Self = Self {
23077 min1: 0.0_f32,
23078 max1: 0.0_f32,
23079 min2: 0.0_f32,
23080 max2: 0.0_f32,
23081 min3: 0.0_f32,
23082 max3: 0.0_f32,
23083 min4: 0.0_f32,
23084 max4: 0.0_f32,
23085 min5: 0.0_f32,
23086 max5: 0.0_f32,
23087 numBands: 0_i8,
23088 type1: IcarousTrackBandTypes::DEFAULT,
23089 type2: IcarousTrackBandTypes::DEFAULT,
23090 type3: IcarousTrackBandTypes::DEFAULT,
23091 type4: IcarousTrackBandTypes::DEFAULT,
23092 type5: IcarousTrackBandTypes::DEFAULT,
23093 };
23094 #[cfg(feature = "arbitrary")]
23095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23096 use arbitrary::{Arbitrary, Unstructured};
23097 let mut buf = [0u8; 1024];
23098 rng.fill_bytes(&mut buf);
23099 let mut unstructured = Unstructured::new(&buf);
23100 Self::arbitrary(&mut unstructured).unwrap_or_default()
23101 }
23102}
23103impl Default for ICAROUS_KINEMATIC_BANDS_DATA {
23104 fn default() -> Self {
23105 Self::DEFAULT.clone()
23106 }
23107}
23108impl MessageData for ICAROUS_KINEMATIC_BANDS_DATA {
23109 type Message = MavMessage;
23110 const ID: u32 = 42001u32;
23111 const NAME: &'static str = "ICAROUS_KINEMATIC_BANDS";
23112 const EXTRA_CRC: u8 = 239u8;
23113 const ENCODED_LEN: usize = 46usize;
23114 fn deser(
23115 _version: MavlinkVersion,
23116 __input: &[u8],
23117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23118 let avail_len = __input.len();
23119 let mut payload_buf = [0; Self::ENCODED_LEN];
23120 let mut buf = if avail_len < Self::ENCODED_LEN {
23121 payload_buf[0..avail_len].copy_from_slice(__input);
23122 Bytes::new(&payload_buf)
23123 } else {
23124 Bytes::new(__input)
23125 };
23126 let mut __struct = Self::default();
23127 __struct.min1 = buf.get_f32_le();
23128 __struct.max1 = buf.get_f32_le();
23129 __struct.min2 = buf.get_f32_le();
23130 __struct.max2 = buf.get_f32_le();
23131 __struct.min3 = buf.get_f32_le();
23132 __struct.max3 = buf.get_f32_le();
23133 __struct.min4 = buf.get_f32_le();
23134 __struct.max4 = buf.get_f32_le();
23135 __struct.min5 = buf.get_f32_le();
23136 __struct.max5 = buf.get_f32_le();
23137 __struct.numBands = buf.get_i8();
23138 let tmp = buf.get_u8();
23139 __struct.type1 =
23140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23141 enum_type: "IcarousTrackBandTypes",
23142 value: tmp as u32,
23143 })?;
23144 let tmp = buf.get_u8();
23145 __struct.type2 =
23146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23147 enum_type: "IcarousTrackBandTypes",
23148 value: tmp as u32,
23149 })?;
23150 let tmp = buf.get_u8();
23151 __struct.type3 =
23152 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23153 enum_type: "IcarousTrackBandTypes",
23154 value: tmp as u32,
23155 })?;
23156 let tmp = buf.get_u8();
23157 __struct.type4 =
23158 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23159 enum_type: "IcarousTrackBandTypes",
23160 value: tmp as u32,
23161 })?;
23162 let tmp = buf.get_u8();
23163 __struct.type5 =
23164 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23165 enum_type: "IcarousTrackBandTypes",
23166 value: tmp as u32,
23167 })?;
23168 Ok(__struct)
23169 }
23170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23171 let mut __tmp = BytesMut::new(bytes);
23172 #[allow(clippy::absurd_extreme_comparisons)]
23173 #[allow(unused_comparisons)]
23174 if __tmp.remaining() < Self::ENCODED_LEN {
23175 panic!(
23176 "buffer is too small (need {} bytes, but got {})",
23177 Self::ENCODED_LEN,
23178 __tmp.remaining(),
23179 )
23180 }
23181 __tmp.put_f32_le(self.min1);
23182 __tmp.put_f32_le(self.max1);
23183 __tmp.put_f32_le(self.min2);
23184 __tmp.put_f32_le(self.max2);
23185 __tmp.put_f32_le(self.min3);
23186 __tmp.put_f32_le(self.max3);
23187 __tmp.put_f32_le(self.min4);
23188 __tmp.put_f32_le(self.max4);
23189 __tmp.put_f32_le(self.min5);
23190 __tmp.put_f32_le(self.max5);
23191 __tmp.put_i8(self.numBands);
23192 __tmp.put_u8(self.type1 as u8);
23193 __tmp.put_u8(self.type2 as u8);
23194 __tmp.put_u8(self.type3 as u8);
23195 __tmp.put_u8(self.type4 as u8);
23196 __tmp.put_u8(self.type5 as u8);
23197 if matches!(version, MavlinkVersion::V2) {
23198 let len = __tmp.len();
23199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23200 } else {
23201 __tmp.len()
23202 }
23203 }
23204}
23205#[doc = "id: 440"]
23206#[doc = "Illuminator status."]
23207#[derive(Debug, Clone, PartialEq)]
23208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23210pub struct ILLUMINATOR_STATUS_DATA {
23211 #[doc = "Time since the start-up of the illuminator in ms"]
23212 pub uptime_ms: u32,
23213 #[doc = "Errors"]
23214 pub error_status: IlluminatorErrorFlags,
23215 #[doc = "Illuminator brightness"]
23216 pub brightness: f32,
23217 #[doc = "Illuminator strobing period in seconds"]
23218 pub strobe_period: f32,
23219 #[doc = "Illuminator strobing duty cycle"]
23220 pub strobe_duty_cycle: f32,
23221 #[doc = "Temperature in Celsius"]
23222 pub temp_c: f32,
23223 #[doc = "Minimum strobing period in seconds"]
23224 pub min_strobe_period: f32,
23225 #[doc = "Maximum strobing period in seconds"]
23226 pub max_strobe_period: f32,
23227 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
23228 pub enable: u8,
23229 #[doc = "Supported illuminator modes"]
23230 pub mode_bitmask: IlluminatorMode,
23231 #[doc = "Illuminator mode"]
23232 pub mode: IlluminatorMode,
23233}
23234impl ILLUMINATOR_STATUS_DATA {
23235 pub const ENCODED_LEN: usize = 35usize;
23236 pub const DEFAULT: Self = Self {
23237 uptime_ms: 0_u32,
23238 error_status: IlluminatorErrorFlags::DEFAULT,
23239 brightness: 0.0_f32,
23240 strobe_period: 0.0_f32,
23241 strobe_duty_cycle: 0.0_f32,
23242 temp_c: 0.0_f32,
23243 min_strobe_period: 0.0_f32,
23244 max_strobe_period: 0.0_f32,
23245 enable: 0_u8,
23246 mode_bitmask: IlluminatorMode::DEFAULT,
23247 mode: IlluminatorMode::DEFAULT,
23248 };
23249 #[cfg(feature = "arbitrary")]
23250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23251 use arbitrary::{Arbitrary, Unstructured};
23252 let mut buf = [0u8; 1024];
23253 rng.fill_bytes(&mut buf);
23254 let mut unstructured = Unstructured::new(&buf);
23255 Self::arbitrary(&mut unstructured).unwrap_or_default()
23256 }
23257}
23258impl Default for ILLUMINATOR_STATUS_DATA {
23259 fn default() -> Self {
23260 Self::DEFAULT.clone()
23261 }
23262}
23263impl MessageData for ILLUMINATOR_STATUS_DATA {
23264 type Message = MavMessage;
23265 const ID: u32 = 440u32;
23266 const NAME: &'static str = "ILLUMINATOR_STATUS";
23267 const EXTRA_CRC: u8 = 66u8;
23268 const ENCODED_LEN: usize = 35usize;
23269 fn deser(
23270 _version: MavlinkVersion,
23271 __input: &[u8],
23272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23273 let avail_len = __input.len();
23274 let mut payload_buf = [0; Self::ENCODED_LEN];
23275 let mut buf = if avail_len < Self::ENCODED_LEN {
23276 payload_buf[0..avail_len].copy_from_slice(__input);
23277 Bytes::new(&payload_buf)
23278 } else {
23279 Bytes::new(__input)
23280 };
23281 let mut __struct = Self::default();
23282 __struct.uptime_ms = buf.get_u32_le();
23283 let tmp = buf.get_u32_le();
23284 __struct.error_status = IlluminatorErrorFlags::from_bits(
23285 tmp & IlluminatorErrorFlags::all().bits(),
23286 )
23287 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23288 flag_type: "IlluminatorErrorFlags",
23289 value: tmp as u32,
23290 })?;
23291 __struct.brightness = buf.get_f32_le();
23292 __struct.strobe_period = buf.get_f32_le();
23293 __struct.strobe_duty_cycle = buf.get_f32_le();
23294 __struct.temp_c = buf.get_f32_le();
23295 __struct.min_strobe_period = buf.get_f32_le();
23296 __struct.max_strobe_period = buf.get_f32_le();
23297 __struct.enable = buf.get_u8();
23298 let tmp = buf.get_u8();
23299 __struct.mode_bitmask =
23300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23301 enum_type: "IlluminatorMode",
23302 value: tmp as u32,
23303 })?;
23304 let tmp = buf.get_u8();
23305 __struct.mode =
23306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23307 enum_type: "IlluminatorMode",
23308 value: tmp as u32,
23309 })?;
23310 Ok(__struct)
23311 }
23312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23313 let mut __tmp = BytesMut::new(bytes);
23314 #[allow(clippy::absurd_extreme_comparisons)]
23315 #[allow(unused_comparisons)]
23316 if __tmp.remaining() < Self::ENCODED_LEN {
23317 panic!(
23318 "buffer is too small (need {} bytes, but got {})",
23319 Self::ENCODED_LEN,
23320 __tmp.remaining(),
23321 )
23322 }
23323 __tmp.put_u32_le(self.uptime_ms);
23324 __tmp.put_u32_le(self.error_status.bits());
23325 __tmp.put_f32_le(self.brightness);
23326 __tmp.put_f32_le(self.strobe_period);
23327 __tmp.put_f32_le(self.strobe_duty_cycle);
23328 __tmp.put_f32_le(self.temp_c);
23329 __tmp.put_f32_le(self.min_strobe_period);
23330 __tmp.put_f32_le(self.max_strobe_period);
23331 __tmp.put_u8(self.enable);
23332 __tmp.put_u8(self.mode_bitmask as u8);
23333 __tmp.put_u8(self.mode as u8);
23334 if matches!(version, MavlinkVersion::V2) {
23335 let len = __tmp.len();
23336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23337 } else {
23338 __tmp.len()
23339 }
23340 }
23341}
23342#[doc = "id: 335"]
23343#[doc = "Status of the Iridium SBD link."]
23344#[derive(Debug, Clone, PartialEq)]
23345#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23346#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23347pub struct ISBD_LINK_STATUS_DATA {
23348 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23349 pub timestamp: u64,
23350 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23351 pub last_heartbeat: u64,
23352 #[doc = "Number of failed SBD sessions."]
23353 pub failed_sessions: u16,
23354 #[doc = "Number of successful SBD sessions."]
23355 pub successful_sessions: u16,
23356 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
23357 pub signal_quality: u8,
23358 #[doc = "1: Ring call pending, 0: No call pending."]
23359 pub ring_pending: u8,
23360 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
23361 pub tx_session_pending: u8,
23362 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
23363 pub rx_session_pending: u8,
23364}
23365impl ISBD_LINK_STATUS_DATA {
23366 pub const ENCODED_LEN: usize = 24usize;
23367 pub const DEFAULT: Self = Self {
23368 timestamp: 0_u64,
23369 last_heartbeat: 0_u64,
23370 failed_sessions: 0_u16,
23371 successful_sessions: 0_u16,
23372 signal_quality: 0_u8,
23373 ring_pending: 0_u8,
23374 tx_session_pending: 0_u8,
23375 rx_session_pending: 0_u8,
23376 };
23377 #[cfg(feature = "arbitrary")]
23378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23379 use arbitrary::{Arbitrary, Unstructured};
23380 let mut buf = [0u8; 1024];
23381 rng.fill_bytes(&mut buf);
23382 let mut unstructured = Unstructured::new(&buf);
23383 Self::arbitrary(&mut unstructured).unwrap_or_default()
23384 }
23385}
23386impl Default for ISBD_LINK_STATUS_DATA {
23387 fn default() -> Self {
23388 Self::DEFAULT.clone()
23389 }
23390}
23391impl MessageData for ISBD_LINK_STATUS_DATA {
23392 type Message = MavMessage;
23393 const ID: u32 = 335u32;
23394 const NAME: &'static str = "ISBD_LINK_STATUS";
23395 const EXTRA_CRC: u8 = 225u8;
23396 const ENCODED_LEN: usize = 24usize;
23397 fn deser(
23398 _version: MavlinkVersion,
23399 __input: &[u8],
23400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23401 let avail_len = __input.len();
23402 let mut payload_buf = [0; Self::ENCODED_LEN];
23403 let mut buf = if avail_len < Self::ENCODED_LEN {
23404 payload_buf[0..avail_len].copy_from_slice(__input);
23405 Bytes::new(&payload_buf)
23406 } else {
23407 Bytes::new(__input)
23408 };
23409 let mut __struct = Self::default();
23410 __struct.timestamp = buf.get_u64_le();
23411 __struct.last_heartbeat = buf.get_u64_le();
23412 __struct.failed_sessions = buf.get_u16_le();
23413 __struct.successful_sessions = buf.get_u16_le();
23414 __struct.signal_quality = buf.get_u8();
23415 __struct.ring_pending = buf.get_u8();
23416 __struct.tx_session_pending = buf.get_u8();
23417 __struct.rx_session_pending = buf.get_u8();
23418 Ok(__struct)
23419 }
23420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23421 let mut __tmp = BytesMut::new(bytes);
23422 #[allow(clippy::absurd_extreme_comparisons)]
23423 #[allow(unused_comparisons)]
23424 if __tmp.remaining() < Self::ENCODED_LEN {
23425 panic!(
23426 "buffer is too small (need {} bytes, but got {})",
23427 Self::ENCODED_LEN,
23428 __tmp.remaining(),
23429 )
23430 }
23431 __tmp.put_u64_le(self.timestamp);
23432 __tmp.put_u64_le(self.last_heartbeat);
23433 __tmp.put_u16_le(self.failed_sessions);
23434 __tmp.put_u16_le(self.successful_sessions);
23435 __tmp.put_u8(self.signal_quality);
23436 __tmp.put_u8(self.ring_pending);
23437 __tmp.put_u8(self.tx_session_pending);
23438 __tmp.put_u8(self.rx_session_pending);
23439 if matches!(version, MavlinkVersion::V2) {
23440 let len = __tmp.len();
23441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23442 } else {
23443 __tmp.len()
23444 }
23445 }
23446}
23447#[doc = "id: 149"]
23448#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
23449#[derive(Debug, Clone, PartialEq)]
23450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23452pub struct LANDING_TARGET_DATA {
23453 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23454 pub time_usec: u64,
23455 #[doc = "X-axis angular offset of the target from the center of the image"]
23456 pub angle_x: f32,
23457 #[doc = "Y-axis angular offset of the target from the center of the image"]
23458 pub angle_y: f32,
23459 #[doc = "Distance to the target from the vehicle"]
23460 pub distance: f32,
23461 #[doc = "Size of target along x-axis"]
23462 pub size_x: f32,
23463 #[doc = "Size of target along y-axis"]
23464 pub size_y: f32,
23465 #[doc = "The ID of the target if multiple targets are present"]
23466 pub target_num: u8,
23467 #[doc = "Coordinate frame used for following fields."]
23468 pub frame: MavFrame,
23469 #[doc = "X Position of the landing target in MAV_FRAME"]
23470 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23471 pub x: f32,
23472 #[doc = "Y Position of the landing target in MAV_FRAME"]
23473 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23474 pub y: f32,
23475 #[doc = "Z Position of the landing target in MAV_FRAME"]
23476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23477 pub z: f32,
23478 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
23479 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23481 pub q: [f32; 4],
23482 #[doc = "Type of landing target"]
23483 #[cfg_attr(feature = "serde", serde(default))]
23484 pub mavtype: LandingTargetType,
23485 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
23486 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23487 pub position_valid: u8,
23488}
23489impl LANDING_TARGET_DATA {
23490 pub const ENCODED_LEN: usize = 60usize;
23491 pub const DEFAULT: Self = Self {
23492 time_usec: 0_u64,
23493 angle_x: 0.0_f32,
23494 angle_y: 0.0_f32,
23495 distance: 0.0_f32,
23496 size_x: 0.0_f32,
23497 size_y: 0.0_f32,
23498 target_num: 0_u8,
23499 frame: MavFrame::DEFAULT,
23500 x: 0.0_f32,
23501 y: 0.0_f32,
23502 z: 0.0_f32,
23503 q: [0.0_f32; 4usize],
23504 mavtype: LandingTargetType::DEFAULT,
23505 position_valid: 0_u8,
23506 };
23507 #[cfg(feature = "arbitrary")]
23508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23509 use arbitrary::{Arbitrary, Unstructured};
23510 let mut buf = [0u8; 1024];
23511 rng.fill_bytes(&mut buf);
23512 let mut unstructured = Unstructured::new(&buf);
23513 Self::arbitrary(&mut unstructured).unwrap_or_default()
23514 }
23515}
23516impl Default for LANDING_TARGET_DATA {
23517 fn default() -> Self {
23518 Self::DEFAULT.clone()
23519 }
23520}
23521impl MessageData for LANDING_TARGET_DATA {
23522 type Message = MavMessage;
23523 const ID: u32 = 149u32;
23524 const NAME: &'static str = "LANDING_TARGET";
23525 const EXTRA_CRC: u8 = 200u8;
23526 const ENCODED_LEN: usize = 60usize;
23527 fn deser(
23528 _version: MavlinkVersion,
23529 __input: &[u8],
23530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23531 let avail_len = __input.len();
23532 let mut payload_buf = [0; Self::ENCODED_LEN];
23533 let mut buf = if avail_len < Self::ENCODED_LEN {
23534 payload_buf[0..avail_len].copy_from_slice(__input);
23535 Bytes::new(&payload_buf)
23536 } else {
23537 Bytes::new(__input)
23538 };
23539 let mut __struct = Self::default();
23540 __struct.time_usec = buf.get_u64_le();
23541 __struct.angle_x = buf.get_f32_le();
23542 __struct.angle_y = buf.get_f32_le();
23543 __struct.distance = buf.get_f32_le();
23544 __struct.size_x = buf.get_f32_le();
23545 __struct.size_y = buf.get_f32_le();
23546 __struct.target_num = buf.get_u8();
23547 let tmp = buf.get_u8();
23548 __struct.frame =
23549 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23550 enum_type: "MavFrame",
23551 value: tmp as u32,
23552 })?;
23553 __struct.x = buf.get_f32_le();
23554 __struct.y = buf.get_f32_le();
23555 __struct.z = buf.get_f32_le();
23556 for v in &mut __struct.q {
23557 let val = buf.get_f32_le();
23558 *v = val;
23559 }
23560 let tmp = buf.get_u8();
23561 __struct.mavtype =
23562 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23563 enum_type: "LandingTargetType",
23564 value: tmp as u32,
23565 })?;
23566 __struct.position_valid = buf.get_u8();
23567 Ok(__struct)
23568 }
23569 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23570 let mut __tmp = BytesMut::new(bytes);
23571 #[allow(clippy::absurd_extreme_comparisons)]
23572 #[allow(unused_comparisons)]
23573 if __tmp.remaining() < Self::ENCODED_LEN {
23574 panic!(
23575 "buffer is too small (need {} bytes, but got {})",
23576 Self::ENCODED_LEN,
23577 __tmp.remaining(),
23578 )
23579 }
23580 __tmp.put_u64_le(self.time_usec);
23581 __tmp.put_f32_le(self.angle_x);
23582 __tmp.put_f32_le(self.angle_y);
23583 __tmp.put_f32_le(self.distance);
23584 __tmp.put_f32_le(self.size_x);
23585 __tmp.put_f32_le(self.size_y);
23586 __tmp.put_u8(self.target_num);
23587 __tmp.put_u8(self.frame as u8);
23588 __tmp.put_f32_le(self.x);
23589 __tmp.put_f32_le(self.y);
23590 __tmp.put_f32_le(self.z);
23591 for val in &self.q {
23592 __tmp.put_f32_le(*val);
23593 }
23594 __tmp.put_u8(self.mavtype as u8);
23595 __tmp.put_u8(self.position_valid);
23596 if matches!(version, MavlinkVersion::V2) {
23597 let len = __tmp.len();
23598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23599 } else {
23600 __tmp.len()
23601 }
23602 }
23603}
23604#[doc = "id: 186"]
23605#[doc = "Control vehicle LEDs."]
23606#[derive(Debug, Clone, PartialEq)]
23607#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23609pub struct LED_CONTROL_DATA {
23610 #[doc = "System ID."]
23611 pub target_system: u8,
23612 #[doc = "Component ID."]
23613 pub target_component: u8,
23614 #[doc = "Instance (LED instance to control or 255 for all LEDs)."]
23615 pub instance: u8,
23616 #[doc = "Pattern (see LED_PATTERN_ENUM)."]
23617 pub pattern: u8,
23618 #[doc = "Custom Byte Length."]
23619 pub custom_len: u8,
23620 #[doc = "Custom Bytes."]
23621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23622 pub custom_bytes: [u8; 24],
23623}
23624impl LED_CONTROL_DATA {
23625 pub const ENCODED_LEN: usize = 29usize;
23626 pub const DEFAULT: Self = Self {
23627 target_system: 0_u8,
23628 target_component: 0_u8,
23629 instance: 0_u8,
23630 pattern: 0_u8,
23631 custom_len: 0_u8,
23632 custom_bytes: [0_u8; 24usize],
23633 };
23634 #[cfg(feature = "arbitrary")]
23635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23636 use arbitrary::{Arbitrary, Unstructured};
23637 let mut buf = [0u8; 1024];
23638 rng.fill_bytes(&mut buf);
23639 let mut unstructured = Unstructured::new(&buf);
23640 Self::arbitrary(&mut unstructured).unwrap_or_default()
23641 }
23642}
23643impl Default for LED_CONTROL_DATA {
23644 fn default() -> Self {
23645 Self::DEFAULT.clone()
23646 }
23647}
23648impl MessageData for LED_CONTROL_DATA {
23649 type Message = MavMessage;
23650 const ID: u32 = 186u32;
23651 const NAME: &'static str = "LED_CONTROL";
23652 const EXTRA_CRC: u8 = 72u8;
23653 const ENCODED_LEN: usize = 29usize;
23654 fn deser(
23655 _version: MavlinkVersion,
23656 __input: &[u8],
23657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23658 let avail_len = __input.len();
23659 let mut payload_buf = [0; Self::ENCODED_LEN];
23660 let mut buf = if avail_len < Self::ENCODED_LEN {
23661 payload_buf[0..avail_len].copy_from_slice(__input);
23662 Bytes::new(&payload_buf)
23663 } else {
23664 Bytes::new(__input)
23665 };
23666 let mut __struct = Self::default();
23667 __struct.target_system = buf.get_u8();
23668 __struct.target_component = buf.get_u8();
23669 __struct.instance = buf.get_u8();
23670 __struct.pattern = buf.get_u8();
23671 __struct.custom_len = buf.get_u8();
23672 for v in &mut __struct.custom_bytes {
23673 let val = buf.get_u8();
23674 *v = val;
23675 }
23676 Ok(__struct)
23677 }
23678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23679 let mut __tmp = BytesMut::new(bytes);
23680 #[allow(clippy::absurd_extreme_comparisons)]
23681 #[allow(unused_comparisons)]
23682 if __tmp.remaining() < Self::ENCODED_LEN {
23683 panic!(
23684 "buffer is too small (need {} bytes, but got {})",
23685 Self::ENCODED_LEN,
23686 __tmp.remaining(),
23687 )
23688 }
23689 __tmp.put_u8(self.target_system);
23690 __tmp.put_u8(self.target_component);
23691 __tmp.put_u8(self.instance);
23692 __tmp.put_u8(self.pattern);
23693 __tmp.put_u8(self.custom_len);
23694 for val in &self.custom_bytes {
23695 __tmp.put_u8(*val);
23696 }
23697 if matches!(version, MavlinkVersion::V2) {
23698 let len = __tmp.len();
23699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23700 } else {
23701 __tmp.len()
23702 }
23703 }
23704}
23705#[doc = "id: 167"]
23706#[doc = "Status of AP_Limits. Sent in extended status stream when AP_Limits is enabled."]
23707#[derive(Debug, Clone, PartialEq)]
23708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23710pub struct LIMITS_STATUS_DATA {
23711 #[doc = "Time (since boot) of last breach."]
23712 pub last_trigger: u32,
23713 #[doc = "Time (since boot) of last recovery action."]
23714 pub last_action: u32,
23715 #[doc = "Time (since boot) of last successful recovery."]
23716 pub last_recovery: u32,
23717 #[doc = "Time (since boot) of last all-clear."]
23718 pub last_clear: u32,
23719 #[doc = "Number of fence breaches."]
23720 pub breach_count: u16,
23721 #[doc = "State of AP_Limits."]
23722 pub limits_state: LimitsState,
23723 #[doc = "AP_Limit_Module bitfield of enabled modules."]
23724 pub mods_enabled: LimitModule,
23725 #[doc = "AP_Limit_Module bitfield of required modules."]
23726 pub mods_required: LimitModule,
23727 #[doc = "AP_Limit_Module bitfield of triggered modules."]
23728 pub mods_triggered: LimitModule,
23729}
23730impl LIMITS_STATUS_DATA {
23731 pub const ENCODED_LEN: usize = 22usize;
23732 pub const DEFAULT: Self = Self {
23733 last_trigger: 0_u32,
23734 last_action: 0_u32,
23735 last_recovery: 0_u32,
23736 last_clear: 0_u32,
23737 breach_count: 0_u16,
23738 limits_state: LimitsState::DEFAULT,
23739 mods_enabled: LimitModule::DEFAULT,
23740 mods_required: LimitModule::DEFAULT,
23741 mods_triggered: LimitModule::DEFAULT,
23742 };
23743 #[cfg(feature = "arbitrary")]
23744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23745 use arbitrary::{Arbitrary, Unstructured};
23746 let mut buf = [0u8; 1024];
23747 rng.fill_bytes(&mut buf);
23748 let mut unstructured = Unstructured::new(&buf);
23749 Self::arbitrary(&mut unstructured).unwrap_or_default()
23750 }
23751}
23752impl Default for LIMITS_STATUS_DATA {
23753 fn default() -> Self {
23754 Self::DEFAULT.clone()
23755 }
23756}
23757impl MessageData for LIMITS_STATUS_DATA {
23758 type Message = MavMessage;
23759 const ID: u32 = 167u32;
23760 const NAME: &'static str = "LIMITS_STATUS";
23761 const EXTRA_CRC: u8 = 144u8;
23762 const ENCODED_LEN: usize = 22usize;
23763 fn deser(
23764 _version: MavlinkVersion,
23765 __input: &[u8],
23766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23767 let avail_len = __input.len();
23768 let mut payload_buf = [0; Self::ENCODED_LEN];
23769 let mut buf = if avail_len < Self::ENCODED_LEN {
23770 payload_buf[0..avail_len].copy_from_slice(__input);
23771 Bytes::new(&payload_buf)
23772 } else {
23773 Bytes::new(__input)
23774 };
23775 let mut __struct = Self::default();
23776 __struct.last_trigger = buf.get_u32_le();
23777 __struct.last_action = buf.get_u32_le();
23778 __struct.last_recovery = buf.get_u32_le();
23779 __struct.last_clear = buf.get_u32_le();
23780 __struct.breach_count = buf.get_u16_le();
23781 let tmp = buf.get_u8();
23782 __struct.limits_state =
23783 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23784 enum_type: "LimitsState",
23785 value: tmp as u32,
23786 })?;
23787 let tmp = buf.get_u8();
23788 __struct.mods_enabled = LimitModule::from_bits(tmp & LimitModule::all().bits()).ok_or(
23789 ::mavlink_core::error::ParserError::InvalidFlag {
23790 flag_type: "LimitModule",
23791 value: tmp as u32,
23792 },
23793 )?;
23794 let tmp = buf.get_u8();
23795 __struct.mods_required = LimitModule::from_bits(tmp & LimitModule::all().bits()).ok_or(
23796 ::mavlink_core::error::ParserError::InvalidFlag {
23797 flag_type: "LimitModule",
23798 value: tmp as u32,
23799 },
23800 )?;
23801 let tmp = buf.get_u8();
23802 __struct.mods_triggered = LimitModule::from_bits(tmp & LimitModule::all().bits()).ok_or(
23803 ::mavlink_core::error::ParserError::InvalidFlag {
23804 flag_type: "LimitModule",
23805 value: tmp as u32,
23806 },
23807 )?;
23808 Ok(__struct)
23809 }
23810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23811 let mut __tmp = BytesMut::new(bytes);
23812 #[allow(clippy::absurd_extreme_comparisons)]
23813 #[allow(unused_comparisons)]
23814 if __tmp.remaining() < Self::ENCODED_LEN {
23815 panic!(
23816 "buffer is too small (need {} bytes, but got {})",
23817 Self::ENCODED_LEN,
23818 __tmp.remaining(),
23819 )
23820 }
23821 __tmp.put_u32_le(self.last_trigger);
23822 __tmp.put_u32_le(self.last_action);
23823 __tmp.put_u32_le(self.last_recovery);
23824 __tmp.put_u32_le(self.last_clear);
23825 __tmp.put_u16_le(self.breach_count);
23826 __tmp.put_u8(self.limits_state as u8);
23827 __tmp.put_u8(self.mods_enabled.bits());
23828 __tmp.put_u8(self.mods_required.bits());
23829 __tmp.put_u8(self.mods_triggered.bits());
23830 if matches!(version, MavlinkVersion::V2) {
23831 let len = __tmp.len();
23832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23833 } else {
23834 __tmp.len()
23835 }
23836 }
23837}
23838#[doc = "id: 8"]
23839#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
23840#[derive(Debug, Clone, PartialEq)]
23841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23843pub struct LINK_NODE_STATUS_DATA {
23844 #[doc = "Timestamp (time since system boot)."]
23845 pub timestamp: u64,
23846 #[doc = "Transmit rate"]
23847 pub tx_rate: u32,
23848 #[doc = "Receive rate"]
23849 pub rx_rate: u32,
23850 #[doc = "Messages sent"]
23851 pub messages_sent: u32,
23852 #[doc = "Messages received (estimated from counting seq)"]
23853 pub messages_received: u32,
23854 #[doc = "Messages lost (estimated from counting seq)"]
23855 pub messages_lost: u32,
23856 #[doc = "Number of bytes that could not be parsed correctly."]
23857 pub rx_parse_err: u16,
23858 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
23859 pub tx_overflows: u16,
23860 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
23861 pub rx_overflows: u16,
23862 #[doc = "Remaining free transmit buffer space"]
23863 pub tx_buf: u8,
23864 #[doc = "Remaining free receive buffer space"]
23865 pub rx_buf: u8,
23866}
23867impl LINK_NODE_STATUS_DATA {
23868 pub const ENCODED_LEN: usize = 36usize;
23869 pub const DEFAULT: Self = Self {
23870 timestamp: 0_u64,
23871 tx_rate: 0_u32,
23872 rx_rate: 0_u32,
23873 messages_sent: 0_u32,
23874 messages_received: 0_u32,
23875 messages_lost: 0_u32,
23876 rx_parse_err: 0_u16,
23877 tx_overflows: 0_u16,
23878 rx_overflows: 0_u16,
23879 tx_buf: 0_u8,
23880 rx_buf: 0_u8,
23881 };
23882 #[cfg(feature = "arbitrary")]
23883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23884 use arbitrary::{Arbitrary, Unstructured};
23885 let mut buf = [0u8; 1024];
23886 rng.fill_bytes(&mut buf);
23887 let mut unstructured = Unstructured::new(&buf);
23888 Self::arbitrary(&mut unstructured).unwrap_or_default()
23889 }
23890}
23891impl Default for LINK_NODE_STATUS_DATA {
23892 fn default() -> Self {
23893 Self::DEFAULT.clone()
23894 }
23895}
23896impl MessageData for LINK_NODE_STATUS_DATA {
23897 type Message = MavMessage;
23898 const ID: u32 = 8u32;
23899 const NAME: &'static str = "LINK_NODE_STATUS";
23900 const EXTRA_CRC: u8 = 117u8;
23901 const ENCODED_LEN: usize = 36usize;
23902 fn deser(
23903 _version: MavlinkVersion,
23904 __input: &[u8],
23905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23906 let avail_len = __input.len();
23907 let mut payload_buf = [0; Self::ENCODED_LEN];
23908 let mut buf = if avail_len < Self::ENCODED_LEN {
23909 payload_buf[0..avail_len].copy_from_slice(__input);
23910 Bytes::new(&payload_buf)
23911 } else {
23912 Bytes::new(__input)
23913 };
23914 let mut __struct = Self::default();
23915 __struct.timestamp = buf.get_u64_le();
23916 __struct.tx_rate = buf.get_u32_le();
23917 __struct.rx_rate = buf.get_u32_le();
23918 __struct.messages_sent = buf.get_u32_le();
23919 __struct.messages_received = buf.get_u32_le();
23920 __struct.messages_lost = buf.get_u32_le();
23921 __struct.rx_parse_err = buf.get_u16_le();
23922 __struct.tx_overflows = buf.get_u16_le();
23923 __struct.rx_overflows = buf.get_u16_le();
23924 __struct.tx_buf = buf.get_u8();
23925 __struct.rx_buf = buf.get_u8();
23926 Ok(__struct)
23927 }
23928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23929 let mut __tmp = BytesMut::new(bytes);
23930 #[allow(clippy::absurd_extreme_comparisons)]
23931 #[allow(unused_comparisons)]
23932 if __tmp.remaining() < Self::ENCODED_LEN {
23933 panic!(
23934 "buffer is too small (need {} bytes, but got {})",
23935 Self::ENCODED_LEN,
23936 __tmp.remaining(),
23937 )
23938 }
23939 __tmp.put_u64_le(self.timestamp);
23940 __tmp.put_u32_le(self.tx_rate);
23941 __tmp.put_u32_le(self.rx_rate);
23942 __tmp.put_u32_le(self.messages_sent);
23943 __tmp.put_u32_le(self.messages_received);
23944 __tmp.put_u32_le(self.messages_lost);
23945 __tmp.put_u16_le(self.rx_parse_err);
23946 __tmp.put_u16_le(self.tx_overflows);
23947 __tmp.put_u16_le(self.rx_overflows);
23948 __tmp.put_u8(self.tx_buf);
23949 __tmp.put_u8(self.rx_buf);
23950 if matches!(version, MavlinkVersion::V2) {
23951 let len = __tmp.len();
23952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23953 } else {
23954 __tmp.len()
23955 }
23956 }
23957}
23958#[doc = "id: 32"]
23959#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
23960#[derive(Debug, Clone, PartialEq)]
23961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23963pub struct LOCAL_POSITION_NED_DATA {
23964 #[doc = "Timestamp (time since system boot)."]
23965 pub time_boot_ms: u32,
23966 #[doc = "X Position"]
23967 pub x: f32,
23968 #[doc = "Y Position"]
23969 pub y: f32,
23970 #[doc = "Z Position"]
23971 pub z: f32,
23972 #[doc = "X Speed"]
23973 pub vx: f32,
23974 #[doc = "Y Speed"]
23975 pub vy: f32,
23976 #[doc = "Z Speed"]
23977 pub vz: f32,
23978}
23979impl LOCAL_POSITION_NED_DATA {
23980 pub const ENCODED_LEN: usize = 28usize;
23981 pub const DEFAULT: Self = Self {
23982 time_boot_ms: 0_u32,
23983 x: 0.0_f32,
23984 y: 0.0_f32,
23985 z: 0.0_f32,
23986 vx: 0.0_f32,
23987 vy: 0.0_f32,
23988 vz: 0.0_f32,
23989 };
23990 #[cfg(feature = "arbitrary")]
23991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23992 use arbitrary::{Arbitrary, Unstructured};
23993 let mut buf = [0u8; 1024];
23994 rng.fill_bytes(&mut buf);
23995 let mut unstructured = Unstructured::new(&buf);
23996 Self::arbitrary(&mut unstructured).unwrap_or_default()
23997 }
23998}
23999impl Default for LOCAL_POSITION_NED_DATA {
24000 fn default() -> Self {
24001 Self::DEFAULT.clone()
24002 }
24003}
24004impl MessageData for LOCAL_POSITION_NED_DATA {
24005 type Message = MavMessage;
24006 const ID: u32 = 32u32;
24007 const NAME: &'static str = "LOCAL_POSITION_NED";
24008 const EXTRA_CRC: u8 = 185u8;
24009 const ENCODED_LEN: usize = 28usize;
24010 fn deser(
24011 _version: MavlinkVersion,
24012 __input: &[u8],
24013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24014 let avail_len = __input.len();
24015 let mut payload_buf = [0; Self::ENCODED_LEN];
24016 let mut buf = if avail_len < Self::ENCODED_LEN {
24017 payload_buf[0..avail_len].copy_from_slice(__input);
24018 Bytes::new(&payload_buf)
24019 } else {
24020 Bytes::new(__input)
24021 };
24022 let mut __struct = Self::default();
24023 __struct.time_boot_ms = buf.get_u32_le();
24024 __struct.x = buf.get_f32_le();
24025 __struct.y = buf.get_f32_le();
24026 __struct.z = buf.get_f32_le();
24027 __struct.vx = buf.get_f32_le();
24028 __struct.vy = buf.get_f32_le();
24029 __struct.vz = buf.get_f32_le();
24030 Ok(__struct)
24031 }
24032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24033 let mut __tmp = BytesMut::new(bytes);
24034 #[allow(clippy::absurd_extreme_comparisons)]
24035 #[allow(unused_comparisons)]
24036 if __tmp.remaining() < Self::ENCODED_LEN {
24037 panic!(
24038 "buffer is too small (need {} bytes, but got {})",
24039 Self::ENCODED_LEN,
24040 __tmp.remaining(),
24041 )
24042 }
24043 __tmp.put_u32_le(self.time_boot_ms);
24044 __tmp.put_f32_le(self.x);
24045 __tmp.put_f32_le(self.y);
24046 __tmp.put_f32_le(self.z);
24047 __tmp.put_f32_le(self.vx);
24048 __tmp.put_f32_le(self.vy);
24049 __tmp.put_f32_le(self.vz);
24050 if matches!(version, MavlinkVersion::V2) {
24051 let len = __tmp.len();
24052 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24053 } else {
24054 __tmp.len()
24055 }
24056 }
24057}
24058#[doc = "id: 64"]
24059#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
24060#[derive(Debug, Clone, PartialEq)]
24061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24063pub struct LOCAL_POSITION_NED_COV_DATA {
24064 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24065 pub time_usec: u64,
24066 #[doc = "X Position"]
24067 pub x: f32,
24068 #[doc = "Y Position"]
24069 pub y: f32,
24070 #[doc = "Z Position"]
24071 pub z: f32,
24072 #[doc = "X Speed"]
24073 pub vx: f32,
24074 #[doc = "Y Speed"]
24075 pub vy: f32,
24076 #[doc = "Z Speed"]
24077 pub vz: f32,
24078 #[doc = "X Acceleration"]
24079 pub ax: f32,
24080 #[doc = "Y Acceleration"]
24081 pub ay: f32,
24082 #[doc = "Z Acceleration"]
24083 pub az: f32,
24084 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
24085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24086 pub covariance: [f32; 45],
24087 #[doc = "Class id of the estimator this estimate originated from."]
24088 pub estimator_type: MavEstimatorType,
24089}
24090impl LOCAL_POSITION_NED_COV_DATA {
24091 pub const ENCODED_LEN: usize = 225usize;
24092 pub const DEFAULT: Self = Self {
24093 time_usec: 0_u64,
24094 x: 0.0_f32,
24095 y: 0.0_f32,
24096 z: 0.0_f32,
24097 vx: 0.0_f32,
24098 vy: 0.0_f32,
24099 vz: 0.0_f32,
24100 ax: 0.0_f32,
24101 ay: 0.0_f32,
24102 az: 0.0_f32,
24103 covariance: [0.0_f32; 45usize],
24104 estimator_type: MavEstimatorType::DEFAULT,
24105 };
24106 #[cfg(feature = "arbitrary")]
24107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24108 use arbitrary::{Arbitrary, Unstructured};
24109 let mut buf = [0u8; 1024];
24110 rng.fill_bytes(&mut buf);
24111 let mut unstructured = Unstructured::new(&buf);
24112 Self::arbitrary(&mut unstructured).unwrap_or_default()
24113 }
24114}
24115impl Default for LOCAL_POSITION_NED_COV_DATA {
24116 fn default() -> Self {
24117 Self::DEFAULT.clone()
24118 }
24119}
24120impl MessageData for LOCAL_POSITION_NED_COV_DATA {
24121 type Message = MavMessage;
24122 const ID: u32 = 64u32;
24123 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
24124 const EXTRA_CRC: u8 = 191u8;
24125 const ENCODED_LEN: usize = 225usize;
24126 fn deser(
24127 _version: MavlinkVersion,
24128 __input: &[u8],
24129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24130 let avail_len = __input.len();
24131 let mut payload_buf = [0; Self::ENCODED_LEN];
24132 let mut buf = if avail_len < Self::ENCODED_LEN {
24133 payload_buf[0..avail_len].copy_from_slice(__input);
24134 Bytes::new(&payload_buf)
24135 } else {
24136 Bytes::new(__input)
24137 };
24138 let mut __struct = Self::default();
24139 __struct.time_usec = buf.get_u64_le();
24140 __struct.x = buf.get_f32_le();
24141 __struct.y = buf.get_f32_le();
24142 __struct.z = buf.get_f32_le();
24143 __struct.vx = buf.get_f32_le();
24144 __struct.vy = buf.get_f32_le();
24145 __struct.vz = buf.get_f32_le();
24146 __struct.ax = buf.get_f32_le();
24147 __struct.ay = buf.get_f32_le();
24148 __struct.az = buf.get_f32_le();
24149 for v in &mut __struct.covariance {
24150 let val = buf.get_f32_le();
24151 *v = val;
24152 }
24153 let tmp = buf.get_u8();
24154 __struct.estimator_type =
24155 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24156 enum_type: "MavEstimatorType",
24157 value: tmp as u32,
24158 })?;
24159 Ok(__struct)
24160 }
24161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24162 let mut __tmp = BytesMut::new(bytes);
24163 #[allow(clippy::absurd_extreme_comparisons)]
24164 #[allow(unused_comparisons)]
24165 if __tmp.remaining() < Self::ENCODED_LEN {
24166 panic!(
24167 "buffer is too small (need {} bytes, but got {})",
24168 Self::ENCODED_LEN,
24169 __tmp.remaining(),
24170 )
24171 }
24172 __tmp.put_u64_le(self.time_usec);
24173 __tmp.put_f32_le(self.x);
24174 __tmp.put_f32_le(self.y);
24175 __tmp.put_f32_le(self.z);
24176 __tmp.put_f32_le(self.vx);
24177 __tmp.put_f32_le(self.vy);
24178 __tmp.put_f32_le(self.vz);
24179 __tmp.put_f32_le(self.ax);
24180 __tmp.put_f32_le(self.ay);
24181 __tmp.put_f32_le(self.az);
24182 for val in &self.covariance {
24183 __tmp.put_f32_le(*val);
24184 }
24185 __tmp.put_u8(self.estimator_type as u8);
24186 if matches!(version, MavlinkVersion::V2) {
24187 let len = __tmp.len();
24188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24189 } else {
24190 __tmp.len()
24191 }
24192 }
24193}
24194#[doc = "id: 89"]
24195#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
24196#[derive(Debug, Clone, PartialEq)]
24197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24199pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
24200 #[doc = "Timestamp (time since system boot)."]
24201 pub time_boot_ms: u32,
24202 #[doc = "X Position"]
24203 pub x: f32,
24204 #[doc = "Y Position"]
24205 pub y: f32,
24206 #[doc = "Z Position"]
24207 pub z: f32,
24208 #[doc = "Roll"]
24209 pub roll: f32,
24210 #[doc = "Pitch"]
24211 pub pitch: f32,
24212 #[doc = "Yaw"]
24213 pub yaw: f32,
24214}
24215impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
24216 pub const ENCODED_LEN: usize = 28usize;
24217 pub const DEFAULT: Self = Self {
24218 time_boot_ms: 0_u32,
24219 x: 0.0_f32,
24220 y: 0.0_f32,
24221 z: 0.0_f32,
24222 roll: 0.0_f32,
24223 pitch: 0.0_f32,
24224 yaw: 0.0_f32,
24225 };
24226 #[cfg(feature = "arbitrary")]
24227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24228 use arbitrary::{Arbitrary, Unstructured};
24229 let mut buf = [0u8; 1024];
24230 rng.fill_bytes(&mut buf);
24231 let mut unstructured = Unstructured::new(&buf);
24232 Self::arbitrary(&mut unstructured).unwrap_or_default()
24233 }
24234}
24235impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
24236 fn default() -> Self {
24237 Self::DEFAULT.clone()
24238 }
24239}
24240impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
24241 type Message = MavMessage;
24242 const ID: u32 = 89u32;
24243 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
24244 const EXTRA_CRC: u8 = 231u8;
24245 const ENCODED_LEN: usize = 28usize;
24246 fn deser(
24247 _version: MavlinkVersion,
24248 __input: &[u8],
24249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24250 let avail_len = __input.len();
24251 let mut payload_buf = [0; Self::ENCODED_LEN];
24252 let mut buf = if avail_len < Self::ENCODED_LEN {
24253 payload_buf[0..avail_len].copy_from_slice(__input);
24254 Bytes::new(&payload_buf)
24255 } else {
24256 Bytes::new(__input)
24257 };
24258 let mut __struct = Self::default();
24259 __struct.time_boot_ms = buf.get_u32_le();
24260 __struct.x = buf.get_f32_le();
24261 __struct.y = buf.get_f32_le();
24262 __struct.z = buf.get_f32_le();
24263 __struct.roll = buf.get_f32_le();
24264 __struct.pitch = buf.get_f32_le();
24265 __struct.yaw = buf.get_f32_le();
24266 Ok(__struct)
24267 }
24268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24269 let mut __tmp = BytesMut::new(bytes);
24270 #[allow(clippy::absurd_extreme_comparisons)]
24271 #[allow(unused_comparisons)]
24272 if __tmp.remaining() < Self::ENCODED_LEN {
24273 panic!(
24274 "buffer is too small (need {} bytes, but got {})",
24275 Self::ENCODED_LEN,
24276 __tmp.remaining(),
24277 )
24278 }
24279 __tmp.put_u32_le(self.time_boot_ms);
24280 __tmp.put_f32_le(self.x);
24281 __tmp.put_f32_le(self.y);
24282 __tmp.put_f32_le(self.z);
24283 __tmp.put_f32_le(self.roll);
24284 __tmp.put_f32_le(self.pitch);
24285 __tmp.put_f32_le(self.yaw);
24286 if matches!(version, MavlinkVersion::V2) {
24287 let len = __tmp.len();
24288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24289 } else {
24290 __tmp.len()
24291 }
24292 }
24293}
24294#[doc = "id: 268"]
24295#[doc = "An ack for a LOGGING_DATA_ACKED message."]
24296#[derive(Debug, Clone, PartialEq)]
24297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24299pub struct LOGGING_ACK_DATA {
24300 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
24301 pub sequence: u16,
24302 #[doc = "system ID of the target"]
24303 pub target_system: u8,
24304 #[doc = "component ID of the target"]
24305 pub target_component: u8,
24306}
24307impl LOGGING_ACK_DATA {
24308 pub const ENCODED_LEN: usize = 4usize;
24309 pub const DEFAULT: Self = Self {
24310 sequence: 0_u16,
24311 target_system: 0_u8,
24312 target_component: 0_u8,
24313 };
24314 #[cfg(feature = "arbitrary")]
24315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24316 use arbitrary::{Arbitrary, Unstructured};
24317 let mut buf = [0u8; 1024];
24318 rng.fill_bytes(&mut buf);
24319 let mut unstructured = Unstructured::new(&buf);
24320 Self::arbitrary(&mut unstructured).unwrap_or_default()
24321 }
24322}
24323impl Default for LOGGING_ACK_DATA {
24324 fn default() -> Self {
24325 Self::DEFAULT.clone()
24326 }
24327}
24328impl MessageData for LOGGING_ACK_DATA {
24329 type Message = MavMessage;
24330 const ID: u32 = 268u32;
24331 const NAME: &'static str = "LOGGING_ACK";
24332 const EXTRA_CRC: u8 = 14u8;
24333 const ENCODED_LEN: usize = 4usize;
24334 fn deser(
24335 _version: MavlinkVersion,
24336 __input: &[u8],
24337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24338 let avail_len = __input.len();
24339 let mut payload_buf = [0; Self::ENCODED_LEN];
24340 let mut buf = if avail_len < Self::ENCODED_LEN {
24341 payload_buf[0..avail_len].copy_from_slice(__input);
24342 Bytes::new(&payload_buf)
24343 } else {
24344 Bytes::new(__input)
24345 };
24346 let mut __struct = Self::default();
24347 __struct.sequence = buf.get_u16_le();
24348 __struct.target_system = buf.get_u8();
24349 __struct.target_component = buf.get_u8();
24350 Ok(__struct)
24351 }
24352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24353 let mut __tmp = BytesMut::new(bytes);
24354 #[allow(clippy::absurd_extreme_comparisons)]
24355 #[allow(unused_comparisons)]
24356 if __tmp.remaining() < Self::ENCODED_LEN {
24357 panic!(
24358 "buffer is too small (need {} bytes, but got {})",
24359 Self::ENCODED_LEN,
24360 __tmp.remaining(),
24361 )
24362 }
24363 __tmp.put_u16_le(self.sequence);
24364 __tmp.put_u8(self.target_system);
24365 __tmp.put_u8(self.target_component);
24366 if matches!(version, MavlinkVersion::V2) {
24367 let len = __tmp.len();
24368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24369 } else {
24370 __tmp.len()
24371 }
24372 }
24373}
24374#[doc = "id: 266"]
24375#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
24376#[derive(Debug, Clone, PartialEq)]
24377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24379pub struct LOGGING_DATA_DATA {
24380 #[doc = "sequence number (can wrap)"]
24381 pub sequence: u16,
24382 #[doc = "system ID of the target"]
24383 pub target_system: u8,
24384 #[doc = "component ID of the target"]
24385 pub target_component: u8,
24386 #[doc = "data length"]
24387 pub length: u8,
24388 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
24389 pub first_message_offset: u8,
24390 #[doc = "logged data"]
24391 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24392 pub data: [u8; 249],
24393}
24394impl LOGGING_DATA_DATA {
24395 pub const ENCODED_LEN: usize = 255usize;
24396 pub const DEFAULT: Self = Self {
24397 sequence: 0_u16,
24398 target_system: 0_u8,
24399 target_component: 0_u8,
24400 length: 0_u8,
24401 first_message_offset: 0_u8,
24402 data: [0_u8; 249usize],
24403 };
24404 #[cfg(feature = "arbitrary")]
24405 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24406 use arbitrary::{Arbitrary, Unstructured};
24407 let mut buf = [0u8; 1024];
24408 rng.fill_bytes(&mut buf);
24409 let mut unstructured = Unstructured::new(&buf);
24410 Self::arbitrary(&mut unstructured).unwrap_or_default()
24411 }
24412}
24413impl Default for LOGGING_DATA_DATA {
24414 fn default() -> Self {
24415 Self::DEFAULT.clone()
24416 }
24417}
24418impl MessageData for LOGGING_DATA_DATA {
24419 type Message = MavMessage;
24420 const ID: u32 = 266u32;
24421 const NAME: &'static str = "LOGGING_DATA";
24422 const EXTRA_CRC: u8 = 193u8;
24423 const ENCODED_LEN: usize = 255usize;
24424 fn deser(
24425 _version: MavlinkVersion,
24426 __input: &[u8],
24427 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24428 let avail_len = __input.len();
24429 let mut payload_buf = [0; Self::ENCODED_LEN];
24430 let mut buf = if avail_len < Self::ENCODED_LEN {
24431 payload_buf[0..avail_len].copy_from_slice(__input);
24432 Bytes::new(&payload_buf)
24433 } else {
24434 Bytes::new(__input)
24435 };
24436 let mut __struct = Self::default();
24437 __struct.sequence = buf.get_u16_le();
24438 __struct.target_system = buf.get_u8();
24439 __struct.target_component = buf.get_u8();
24440 __struct.length = buf.get_u8();
24441 __struct.first_message_offset = buf.get_u8();
24442 for v in &mut __struct.data {
24443 let val = buf.get_u8();
24444 *v = val;
24445 }
24446 Ok(__struct)
24447 }
24448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24449 let mut __tmp = BytesMut::new(bytes);
24450 #[allow(clippy::absurd_extreme_comparisons)]
24451 #[allow(unused_comparisons)]
24452 if __tmp.remaining() < Self::ENCODED_LEN {
24453 panic!(
24454 "buffer is too small (need {} bytes, but got {})",
24455 Self::ENCODED_LEN,
24456 __tmp.remaining(),
24457 )
24458 }
24459 __tmp.put_u16_le(self.sequence);
24460 __tmp.put_u8(self.target_system);
24461 __tmp.put_u8(self.target_component);
24462 __tmp.put_u8(self.length);
24463 __tmp.put_u8(self.first_message_offset);
24464 for val in &self.data {
24465 __tmp.put_u8(*val);
24466 }
24467 if matches!(version, MavlinkVersion::V2) {
24468 let len = __tmp.len();
24469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24470 } else {
24471 __tmp.len()
24472 }
24473 }
24474}
24475#[doc = "id: 267"]
24476#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
24477#[derive(Debug, Clone, PartialEq)]
24478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24480pub struct LOGGING_DATA_ACKED_DATA {
24481 #[doc = "sequence number (can wrap)"]
24482 pub sequence: u16,
24483 #[doc = "system ID of the target"]
24484 pub target_system: u8,
24485 #[doc = "component ID of the target"]
24486 pub target_component: u8,
24487 #[doc = "data length"]
24488 pub length: u8,
24489 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
24490 pub first_message_offset: u8,
24491 #[doc = "logged data"]
24492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24493 pub data: [u8; 249],
24494}
24495impl LOGGING_DATA_ACKED_DATA {
24496 pub const ENCODED_LEN: usize = 255usize;
24497 pub const DEFAULT: Self = Self {
24498 sequence: 0_u16,
24499 target_system: 0_u8,
24500 target_component: 0_u8,
24501 length: 0_u8,
24502 first_message_offset: 0_u8,
24503 data: [0_u8; 249usize],
24504 };
24505 #[cfg(feature = "arbitrary")]
24506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24507 use arbitrary::{Arbitrary, Unstructured};
24508 let mut buf = [0u8; 1024];
24509 rng.fill_bytes(&mut buf);
24510 let mut unstructured = Unstructured::new(&buf);
24511 Self::arbitrary(&mut unstructured).unwrap_or_default()
24512 }
24513}
24514impl Default for LOGGING_DATA_ACKED_DATA {
24515 fn default() -> Self {
24516 Self::DEFAULT.clone()
24517 }
24518}
24519impl MessageData for LOGGING_DATA_ACKED_DATA {
24520 type Message = MavMessage;
24521 const ID: u32 = 267u32;
24522 const NAME: &'static str = "LOGGING_DATA_ACKED";
24523 const EXTRA_CRC: u8 = 35u8;
24524 const ENCODED_LEN: usize = 255usize;
24525 fn deser(
24526 _version: MavlinkVersion,
24527 __input: &[u8],
24528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24529 let avail_len = __input.len();
24530 let mut payload_buf = [0; Self::ENCODED_LEN];
24531 let mut buf = if avail_len < Self::ENCODED_LEN {
24532 payload_buf[0..avail_len].copy_from_slice(__input);
24533 Bytes::new(&payload_buf)
24534 } else {
24535 Bytes::new(__input)
24536 };
24537 let mut __struct = Self::default();
24538 __struct.sequence = buf.get_u16_le();
24539 __struct.target_system = buf.get_u8();
24540 __struct.target_component = buf.get_u8();
24541 __struct.length = buf.get_u8();
24542 __struct.first_message_offset = buf.get_u8();
24543 for v in &mut __struct.data {
24544 let val = buf.get_u8();
24545 *v = val;
24546 }
24547 Ok(__struct)
24548 }
24549 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24550 let mut __tmp = BytesMut::new(bytes);
24551 #[allow(clippy::absurd_extreme_comparisons)]
24552 #[allow(unused_comparisons)]
24553 if __tmp.remaining() < Self::ENCODED_LEN {
24554 panic!(
24555 "buffer is too small (need {} bytes, but got {})",
24556 Self::ENCODED_LEN,
24557 __tmp.remaining(),
24558 )
24559 }
24560 __tmp.put_u16_le(self.sequence);
24561 __tmp.put_u8(self.target_system);
24562 __tmp.put_u8(self.target_component);
24563 __tmp.put_u8(self.length);
24564 __tmp.put_u8(self.first_message_offset);
24565 for val in &self.data {
24566 __tmp.put_u8(*val);
24567 }
24568 if matches!(version, MavlinkVersion::V2) {
24569 let len = __tmp.len();
24570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24571 } else {
24572 __tmp.len()
24573 }
24574 }
24575}
24576#[doc = "id: 120"]
24577#[doc = "Reply to LOG_REQUEST_DATA."]
24578#[derive(Debug, Clone, PartialEq)]
24579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24581pub struct LOG_DATA_DATA {
24582 #[doc = "Offset into the log"]
24583 pub ofs: u32,
24584 #[doc = "Log id (from LOG_ENTRY reply)"]
24585 pub id: u16,
24586 #[doc = "Number of bytes (zero for end of log)"]
24587 pub count: u8,
24588 #[doc = "log data"]
24589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24590 pub data: [u8; 90],
24591}
24592impl LOG_DATA_DATA {
24593 pub const ENCODED_LEN: usize = 97usize;
24594 pub const DEFAULT: Self = Self {
24595 ofs: 0_u32,
24596 id: 0_u16,
24597 count: 0_u8,
24598 data: [0_u8; 90usize],
24599 };
24600 #[cfg(feature = "arbitrary")]
24601 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24602 use arbitrary::{Arbitrary, Unstructured};
24603 let mut buf = [0u8; 1024];
24604 rng.fill_bytes(&mut buf);
24605 let mut unstructured = Unstructured::new(&buf);
24606 Self::arbitrary(&mut unstructured).unwrap_or_default()
24607 }
24608}
24609impl Default for LOG_DATA_DATA {
24610 fn default() -> Self {
24611 Self::DEFAULT.clone()
24612 }
24613}
24614impl MessageData for LOG_DATA_DATA {
24615 type Message = MavMessage;
24616 const ID: u32 = 120u32;
24617 const NAME: &'static str = "LOG_DATA";
24618 const EXTRA_CRC: u8 = 134u8;
24619 const ENCODED_LEN: usize = 97usize;
24620 fn deser(
24621 _version: MavlinkVersion,
24622 __input: &[u8],
24623 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24624 let avail_len = __input.len();
24625 let mut payload_buf = [0; Self::ENCODED_LEN];
24626 let mut buf = if avail_len < Self::ENCODED_LEN {
24627 payload_buf[0..avail_len].copy_from_slice(__input);
24628 Bytes::new(&payload_buf)
24629 } else {
24630 Bytes::new(__input)
24631 };
24632 let mut __struct = Self::default();
24633 __struct.ofs = buf.get_u32_le();
24634 __struct.id = buf.get_u16_le();
24635 __struct.count = buf.get_u8();
24636 for v in &mut __struct.data {
24637 let val = buf.get_u8();
24638 *v = val;
24639 }
24640 Ok(__struct)
24641 }
24642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24643 let mut __tmp = BytesMut::new(bytes);
24644 #[allow(clippy::absurd_extreme_comparisons)]
24645 #[allow(unused_comparisons)]
24646 if __tmp.remaining() < Self::ENCODED_LEN {
24647 panic!(
24648 "buffer is too small (need {} bytes, but got {})",
24649 Self::ENCODED_LEN,
24650 __tmp.remaining(),
24651 )
24652 }
24653 __tmp.put_u32_le(self.ofs);
24654 __tmp.put_u16_le(self.id);
24655 __tmp.put_u8(self.count);
24656 for val in &self.data {
24657 __tmp.put_u8(*val);
24658 }
24659 if matches!(version, MavlinkVersion::V2) {
24660 let len = __tmp.len();
24661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24662 } else {
24663 __tmp.len()
24664 }
24665 }
24666}
24667#[doc = "id: 118"]
24668#[doc = "Reply to LOG_REQUEST_LIST."]
24669#[derive(Debug, Clone, PartialEq)]
24670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24672pub struct LOG_ENTRY_DATA {
24673 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
24674 pub time_utc: u32,
24675 #[doc = "Size of the log (may be approximate)"]
24676 pub size: u32,
24677 #[doc = "Log id"]
24678 pub id: u16,
24679 #[doc = "Total number of logs"]
24680 pub num_logs: u16,
24681 #[doc = "High log number"]
24682 pub last_log_num: u16,
24683}
24684impl LOG_ENTRY_DATA {
24685 pub const ENCODED_LEN: usize = 14usize;
24686 pub const DEFAULT: Self = Self {
24687 time_utc: 0_u32,
24688 size: 0_u32,
24689 id: 0_u16,
24690 num_logs: 0_u16,
24691 last_log_num: 0_u16,
24692 };
24693 #[cfg(feature = "arbitrary")]
24694 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24695 use arbitrary::{Arbitrary, Unstructured};
24696 let mut buf = [0u8; 1024];
24697 rng.fill_bytes(&mut buf);
24698 let mut unstructured = Unstructured::new(&buf);
24699 Self::arbitrary(&mut unstructured).unwrap_or_default()
24700 }
24701}
24702impl Default for LOG_ENTRY_DATA {
24703 fn default() -> Self {
24704 Self::DEFAULT.clone()
24705 }
24706}
24707impl MessageData for LOG_ENTRY_DATA {
24708 type Message = MavMessage;
24709 const ID: u32 = 118u32;
24710 const NAME: &'static str = "LOG_ENTRY";
24711 const EXTRA_CRC: u8 = 56u8;
24712 const ENCODED_LEN: usize = 14usize;
24713 fn deser(
24714 _version: MavlinkVersion,
24715 __input: &[u8],
24716 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24717 let avail_len = __input.len();
24718 let mut payload_buf = [0; Self::ENCODED_LEN];
24719 let mut buf = if avail_len < Self::ENCODED_LEN {
24720 payload_buf[0..avail_len].copy_from_slice(__input);
24721 Bytes::new(&payload_buf)
24722 } else {
24723 Bytes::new(__input)
24724 };
24725 let mut __struct = Self::default();
24726 __struct.time_utc = buf.get_u32_le();
24727 __struct.size = buf.get_u32_le();
24728 __struct.id = buf.get_u16_le();
24729 __struct.num_logs = buf.get_u16_le();
24730 __struct.last_log_num = buf.get_u16_le();
24731 Ok(__struct)
24732 }
24733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24734 let mut __tmp = BytesMut::new(bytes);
24735 #[allow(clippy::absurd_extreme_comparisons)]
24736 #[allow(unused_comparisons)]
24737 if __tmp.remaining() < Self::ENCODED_LEN {
24738 panic!(
24739 "buffer is too small (need {} bytes, but got {})",
24740 Self::ENCODED_LEN,
24741 __tmp.remaining(),
24742 )
24743 }
24744 __tmp.put_u32_le(self.time_utc);
24745 __tmp.put_u32_le(self.size);
24746 __tmp.put_u16_le(self.id);
24747 __tmp.put_u16_le(self.num_logs);
24748 __tmp.put_u16_le(self.last_log_num);
24749 if matches!(version, MavlinkVersion::V2) {
24750 let len = __tmp.len();
24751 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24752 } else {
24753 __tmp.len()
24754 }
24755 }
24756}
24757#[doc = "id: 121"]
24758#[doc = "Erase all logs."]
24759#[derive(Debug, Clone, PartialEq)]
24760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24762pub struct LOG_ERASE_DATA {
24763 #[doc = "System ID"]
24764 pub target_system: u8,
24765 #[doc = "Component ID"]
24766 pub target_component: u8,
24767}
24768impl LOG_ERASE_DATA {
24769 pub const ENCODED_LEN: usize = 2usize;
24770 pub const DEFAULT: Self = Self {
24771 target_system: 0_u8,
24772 target_component: 0_u8,
24773 };
24774 #[cfg(feature = "arbitrary")]
24775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24776 use arbitrary::{Arbitrary, Unstructured};
24777 let mut buf = [0u8; 1024];
24778 rng.fill_bytes(&mut buf);
24779 let mut unstructured = Unstructured::new(&buf);
24780 Self::arbitrary(&mut unstructured).unwrap_or_default()
24781 }
24782}
24783impl Default for LOG_ERASE_DATA {
24784 fn default() -> Self {
24785 Self::DEFAULT.clone()
24786 }
24787}
24788impl MessageData for LOG_ERASE_DATA {
24789 type Message = MavMessage;
24790 const ID: u32 = 121u32;
24791 const NAME: &'static str = "LOG_ERASE";
24792 const EXTRA_CRC: u8 = 237u8;
24793 const ENCODED_LEN: usize = 2usize;
24794 fn deser(
24795 _version: MavlinkVersion,
24796 __input: &[u8],
24797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24798 let avail_len = __input.len();
24799 let mut payload_buf = [0; Self::ENCODED_LEN];
24800 let mut buf = if avail_len < Self::ENCODED_LEN {
24801 payload_buf[0..avail_len].copy_from_slice(__input);
24802 Bytes::new(&payload_buf)
24803 } else {
24804 Bytes::new(__input)
24805 };
24806 let mut __struct = Self::default();
24807 __struct.target_system = buf.get_u8();
24808 __struct.target_component = buf.get_u8();
24809 Ok(__struct)
24810 }
24811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24812 let mut __tmp = BytesMut::new(bytes);
24813 #[allow(clippy::absurd_extreme_comparisons)]
24814 #[allow(unused_comparisons)]
24815 if __tmp.remaining() < Self::ENCODED_LEN {
24816 panic!(
24817 "buffer is too small (need {} bytes, but got {})",
24818 Self::ENCODED_LEN,
24819 __tmp.remaining(),
24820 )
24821 }
24822 __tmp.put_u8(self.target_system);
24823 __tmp.put_u8(self.target_component);
24824 if matches!(version, MavlinkVersion::V2) {
24825 let len = __tmp.len();
24826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24827 } else {
24828 __tmp.len()
24829 }
24830 }
24831}
24832#[doc = "id: 119"]
24833#[doc = "Request a chunk of a log."]
24834#[derive(Debug, Clone, PartialEq)]
24835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24837pub struct LOG_REQUEST_DATA_DATA {
24838 #[doc = "Offset into the log"]
24839 pub ofs: u32,
24840 #[doc = "Number of bytes"]
24841 pub count: u32,
24842 #[doc = "Log id (from LOG_ENTRY reply)"]
24843 pub id: u16,
24844 #[doc = "System ID"]
24845 pub target_system: u8,
24846 #[doc = "Component ID"]
24847 pub target_component: u8,
24848}
24849impl LOG_REQUEST_DATA_DATA {
24850 pub const ENCODED_LEN: usize = 12usize;
24851 pub const DEFAULT: Self = Self {
24852 ofs: 0_u32,
24853 count: 0_u32,
24854 id: 0_u16,
24855 target_system: 0_u8,
24856 target_component: 0_u8,
24857 };
24858 #[cfg(feature = "arbitrary")]
24859 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24860 use arbitrary::{Arbitrary, Unstructured};
24861 let mut buf = [0u8; 1024];
24862 rng.fill_bytes(&mut buf);
24863 let mut unstructured = Unstructured::new(&buf);
24864 Self::arbitrary(&mut unstructured).unwrap_or_default()
24865 }
24866}
24867impl Default for LOG_REQUEST_DATA_DATA {
24868 fn default() -> Self {
24869 Self::DEFAULT.clone()
24870 }
24871}
24872impl MessageData for LOG_REQUEST_DATA_DATA {
24873 type Message = MavMessage;
24874 const ID: u32 = 119u32;
24875 const NAME: &'static str = "LOG_REQUEST_DATA";
24876 const EXTRA_CRC: u8 = 116u8;
24877 const ENCODED_LEN: usize = 12usize;
24878 fn deser(
24879 _version: MavlinkVersion,
24880 __input: &[u8],
24881 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24882 let avail_len = __input.len();
24883 let mut payload_buf = [0; Self::ENCODED_LEN];
24884 let mut buf = if avail_len < Self::ENCODED_LEN {
24885 payload_buf[0..avail_len].copy_from_slice(__input);
24886 Bytes::new(&payload_buf)
24887 } else {
24888 Bytes::new(__input)
24889 };
24890 let mut __struct = Self::default();
24891 __struct.ofs = buf.get_u32_le();
24892 __struct.count = buf.get_u32_le();
24893 __struct.id = buf.get_u16_le();
24894 __struct.target_system = buf.get_u8();
24895 __struct.target_component = buf.get_u8();
24896 Ok(__struct)
24897 }
24898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24899 let mut __tmp = BytesMut::new(bytes);
24900 #[allow(clippy::absurd_extreme_comparisons)]
24901 #[allow(unused_comparisons)]
24902 if __tmp.remaining() < Self::ENCODED_LEN {
24903 panic!(
24904 "buffer is too small (need {} bytes, but got {})",
24905 Self::ENCODED_LEN,
24906 __tmp.remaining(),
24907 )
24908 }
24909 __tmp.put_u32_le(self.ofs);
24910 __tmp.put_u32_le(self.count);
24911 __tmp.put_u16_le(self.id);
24912 __tmp.put_u8(self.target_system);
24913 __tmp.put_u8(self.target_component);
24914 if matches!(version, MavlinkVersion::V2) {
24915 let len = __tmp.len();
24916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24917 } else {
24918 __tmp.len()
24919 }
24920 }
24921}
24922#[doc = "id: 122"]
24923#[doc = "Stop log transfer and resume normal logging."]
24924#[derive(Debug, Clone, PartialEq)]
24925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24927pub struct LOG_REQUEST_END_DATA {
24928 #[doc = "System ID"]
24929 pub target_system: u8,
24930 #[doc = "Component ID"]
24931 pub target_component: u8,
24932}
24933impl LOG_REQUEST_END_DATA {
24934 pub const ENCODED_LEN: usize = 2usize;
24935 pub const DEFAULT: Self = Self {
24936 target_system: 0_u8,
24937 target_component: 0_u8,
24938 };
24939 #[cfg(feature = "arbitrary")]
24940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24941 use arbitrary::{Arbitrary, Unstructured};
24942 let mut buf = [0u8; 1024];
24943 rng.fill_bytes(&mut buf);
24944 let mut unstructured = Unstructured::new(&buf);
24945 Self::arbitrary(&mut unstructured).unwrap_or_default()
24946 }
24947}
24948impl Default for LOG_REQUEST_END_DATA {
24949 fn default() -> Self {
24950 Self::DEFAULT.clone()
24951 }
24952}
24953impl MessageData for LOG_REQUEST_END_DATA {
24954 type Message = MavMessage;
24955 const ID: u32 = 122u32;
24956 const NAME: &'static str = "LOG_REQUEST_END";
24957 const EXTRA_CRC: u8 = 203u8;
24958 const ENCODED_LEN: usize = 2usize;
24959 fn deser(
24960 _version: MavlinkVersion,
24961 __input: &[u8],
24962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24963 let avail_len = __input.len();
24964 let mut payload_buf = [0; Self::ENCODED_LEN];
24965 let mut buf = if avail_len < Self::ENCODED_LEN {
24966 payload_buf[0..avail_len].copy_from_slice(__input);
24967 Bytes::new(&payload_buf)
24968 } else {
24969 Bytes::new(__input)
24970 };
24971 let mut __struct = Self::default();
24972 __struct.target_system = buf.get_u8();
24973 __struct.target_component = buf.get_u8();
24974 Ok(__struct)
24975 }
24976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24977 let mut __tmp = BytesMut::new(bytes);
24978 #[allow(clippy::absurd_extreme_comparisons)]
24979 #[allow(unused_comparisons)]
24980 if __tmp.remaining() < Self::ENCODED_LEN {
24981 panic!(
24982 "buffer is too small (need {} bytes, but got {})",
24983 Self::ENCODED_LEN,
24984 __tmp.remaining(),
24985 )
24986 }
24987 __tmp.put_u8(self.target_system);
24988 __tmp.put_u8(self.target_component);
24989 if matches!(version, MavlinkVersion::V2) {
24990 let len = __tmp.len();
24991 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24992 } else {
24993 __tmp.len()
24994 }
24995 }
24996}
24997#[doc = "id: 117"]
24998#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
24999#[derive(Debug, Clone, PartialEq)]
25000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25002pub struct LOG_REQUEST_LIST_DATA {
25003 #[doc = "First log id (0 for first available)"]
25004 pub start: u16,
25005 #[doc = "Last log id (0xffff for last available)"]
25006 pub end: u16,
25007 #[doc = "System ID"]
25008 pub target_system: u8,
25009 #[doc = "Component ID"]
25010 pub target_component: u8,
25011}
25012impl LOG_REQUEST_LIST_DATA {
25013 pub const ENCODED_LEN: usize = 6usize;
25014 pub const DEFAULT: Self = Self {
25015 start: 0_u16,
25016 end: 0_u16,
25017 target_system: 0_u8,
25018 target_component: 0_u8,
25019 };
25020 #[cfg(feature = "arbitrary")]
25021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25022 use arbitrary::{Arbitrary, Unstructured};
25023 let mut buf = [0u8; 1024];
25024 rng.fill_bytes(&mut buf);
25025 let mut unstructured = Unstructured::new(&buf);
25026 Self::arbitrary(&mut unstructured).unwrap_or_default()
25027 }
25028}
25029impl Default for LOG_REQUEST_LIST_DATA {
25030 fn default() -> Self {
25031 Self::DEFAULT.clone()
25032 }
25033}
25034impl MessageData for LOG_REQUEST_LIST_DATA {
25035 type Message = MavMessage;
25036 const ID: u32 = 117u32;
25037 const NAME: &'static str = "LOG_REQUEST_LIST";
25038 const EXTRA_CRC: u8 = 128u8;
25039 const ENCODED_LEN: usize = 6usize;
25040 fn deser(
25041 _version: MavlinkVersion,
25042 __input: &[u8],
25043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25044 let avail_len = __input.len();
25045 let mut payload_buf = [0; Self::ENCODED_LEN];
25046 let mut buf = if avail_len < Self::ENCODED_LEN {
25047 payload_buf[0..avail_len].copy_from_slice(__input);
25048 Bytes::new(&payload_buf)
25049 } else {
25050 Bytes::new(__input)
25051 };
25052 let mut __struct = Self::default();
25053 __struct.start = buf.get_u16_le();
25054 __struct.end = buf.get_u16_le();
25055 __struct.target_system = buf.get_u8();
25056 __struct.target_component = buf.get_u8();
25057 Ok(__struct)
25058 }
25059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25060 let mut __tmp = BytesMut::new(bytes);
25061 #[allow(clippy::absurd_extreme_comparisons)]
25062 #[allow(unused_comparisons)]
25063 if __tmp.remaining() < Self::ENCODED_LEN {
25064 panic!(
25065 "buffer is too small (need {} bytes, but got {})",
25066 Self::ENCODED_LEN,
25067 __tmp.remaining(),
25068 )
25069 }
25070 __tmp.put_u16_le(self.start);
25071 __tmp.put_u16_le(self.end);
25072 __tmp.put_u8(self.target_system);
25073 __tmp.put_u8(self.target_component);
25074 if matches!(version, MavlinkVersion::V2) {
25075 let len = __tmp.len();
25076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25077 } else {
25078 __tmp.len()
25079 }
25080 }
25081}
25082#[doc = "id: 10151"]
25083#[doc = "Composite EFI and Governor data from Loweheiser equipment. This message is created by the EFI unit based on its own data and data received from a governor attached to that EFI unit."]
25084#[derive(Debug, Clone, PartialEq)]
25085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25087pub struct LOWEHEISER_GOV_EFI_DATA {
25088 #[doc = "Generator Battery voltage."]
25089 pub volt_batt: f32,
25090 #[doc = "Generator Battery current."]
25091 pub curr_batt: f32,
25092 #[doc = "Current being produced by generator."]
25093 pub curr_gen: f32,
25094 #[doc = "Load current being consumed by the UAV (sum of curr_gen and curr_batt)"]
25095 pub curr_rot: f32,
25096 #[doc = "Generator fuel remaining in litres."]
25097 pub fuel_level: f32,
25098 #[doc = "Throttle Output."]
25099 pub throttle: f32,
25100 #[doc = "Seconds this generator has run since it was rebooted."]
25101 pub runtime: u32,
25102 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past due."]
25103 pub until_maintenance: i32,
25104 #[doc = "The Temperature of the rectifier."]
25105 pub rectifier_temp: f32,
25106 #[doc = "The temperature of the mechanical motor, fuel cell core or generator."]
25107 pub generator_temp: f32,
25108 #[doc = "EFI Supply Voltage."]
25109 pub efi_batt: f32,
25110 #[doc = "Motor RPM."]
25111 pub efi_rpm: f32,
25112 #[doc = "Injector pulse-width in miliseconds."]
25113 pub efi_pw: f32,
25114 #[doc = "Fuel flow rate in litres/hour."]
25115 pub efi_fuel_flow: f32,
25116 #[doc = "Fuel consumed."]
25117 pub efi_fuel_consumed: f32,
25118 #[doc = "Atmospheric pressure."]
25119 pub efi_baro: f32,
25120 #[doc = "Manifold Air Temperature."]
25121 pub efi_mat: f32,
25122 #[doc = "Cylinder Head Temperature."]
25123 pub efi_clt: f32,
25124 #[doc = "Throttle Position."]
25125 pub efi_tps: f32,
25126 #[doc = "Exhaust gas temperature."]
25127 pub efi_exhaust_gas_temperature: f32,
25128 #[doc = "Generator status."]
25129 pub generator_status: u16,
25130 #[doc = "EFI status."]
25131 pub efi_status: u16,
25132 #[doc = "EFI index."]
25133 pub efi_index: u8,
25134}
25135impl LOWEHEISER_GOV_EFI_DATA {
25136 pub const ENCODED_LEN: usize = 85usize;
25137 pub const DEFAULT: Self = Self {
25138 volt_batt: 0.0_f32,
25139 curr_batt: 0.0_f32,
25140 curr_gen: 0.0_f32,
25141 curr_rot: 0.0_f32,
25142 fuel_level: 0.0_f32,
25143 throttle: 0.0_f32,
25144 runtime: 0_u32,
25145 until_maintenance: 0_i32,
25146 rectifier_temp: 0.0_f32,
25147 generator_temp: 0.0_f32,
25148 efi_batt: 0.0_f32,
25149 efi_rpm: 0.0_f32,
25150 efi_pw: 0.0_f32,
25151 efi_fuel_flow: 0.0_f32,
25152 efi_fuel_consumed: 0.0_f32,
25153 efi_baro: 0.0_f32,
25154 efi_mat: 0.0_f32,
25155 efi_clt: 0.0_f32,
25156 efi_tps: 0.0_f32,
25157 efi_exhaust_gas_temperature: 0.0_f32,
25158 generator_status: 0_u16,
25159 efi_status: 0_u16,
25160 efi_index: 0_u8,
25161 };
25162 #[cfg(feature = "arbitrary")]
25163 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25164 use arbitrary::{Arbitrary, Unstructured};
25165 let mut buf = [0u8; 1024];
25166 rng.fill_bytes(&mut buf);
25167 let mut unstructured = Unstructured::new(&buf);
25168 Self::arbitrary(&mut unstructured).unwrap_or_default()
25169 }
25170}
25171impl Default for LOWEHEISER_GOV_EFI_DATA {
25172 fn default() -> Self {
25173 Self::DEFAULT.clone()
25174 }
25175}
25176impl MessageData for LOWEHEISER_GOV_EFI_DATA {
25177 type Message = MavMessage;
25178 const ID: u32 = 10151u32;
25179 const NAME: &'static str = "LOWEHEISER_GOV_EFI";
25180 const EXTRA_CRC: u8 = 195u8;
25181 const ENCODED_LEN: usize = 85usize;
25182 fn deser(
25183 _version: MavlinkVersion,
25184 __input: &[u8],
25185 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25186 let avail_len = __input.len();
25187 let mut payload_buf = [0; Self::ENCODED_LEN];
25188 let mut buf = if avail_len < Self::ENCODED_LEN {
25189 payload_buf[0..avail_len].copy_from_slice(__input);
25190 Bytes::new(&payload_buf)
25191 } else {
25192 Bytes::new(__input)
25193 };
25194 let mut __struct = Self::default();
25195 __struct.volt_batt = buf.get_f32_le();
25196 __struct.curr_batt = buf.get_f32_le();
25197 __struct.curr_gen = buf.get_f32_le();
25198 __struct.curr_rot = buf.get_f32_le();
25199 __struct.fuel_level = buf.get_f32_le();
25200 __struct.throttle = buf.get_f32_le();
25201 __struct.runtime = buf.get_u32_le();
25202 __struct.until_maintenance = buf.get_i32_le();
25203 __struct.rectifier_temp = buf.get_f32_le();
25204 __struct.generator_temp = buf.get_f32_le();
25205 __struct.efi_batt = buf.get_f32_le();
25206 __struct.efi_rpm = buf.get_f32_le();
25207 __struct.efi_pw = buf.get_f32_le();
25208 __struct.efi_fuel_flow = buf.get_f32_le();
25209 __struct.efi_fuel_consumed = buf.get_f32_le();
25210 __struct.efi_baro = buf.get_f32_le();
25211 __struct.efi_mat = buf.get_f32_le();
25212 __struct.efi_clt = buf.get_f32_le();
25213 __struct.efi_tps = buf.get_f32_le();
25214 __struct.efi_exhaust_gas_temperature = buf.get_f32_le();
25215 __struct.generator_status = buf.get_u16_le();
25216 __struct.efi_status = buf.get_u16_le();
25217 __struct.efi_index = buf.get_u8();
25218 Ok(__struct)
25219 }
25220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25221 let mut __tmp = BytesMut::new(bytes);
25222 #[allow(clippy::absurd_extreme_comparisons)]
25223 #[allow(unused_comparisons)]
25224 if __tmp.remaining() < Self::ENCODED_LEN {
25225 panic!(
25226 "buffer is too small (need {} bytes, but got {})",
25227 Self::ENCODED_LEN,
25228 __tmp.remaining(),
25229 )
25230 }
25231 __tmp.put_f32_le(self.volt_batt);
25232 __tmp.put_f32_le(self.curr_batt);
25233 __tmp.put_f32_le(self.curr_gen);
25234 __tmp.put_f32_le(self.curr_rot);
25235 __tmp.put_f32_le(self.fuel_level);
25236 __tmp.put_f32_le(self.throttle);
25237 __tmp.put_u32_le(self.runtime);
25238 __tmp.put_i32_le(self.until_maintenance);
25239 __tmp.put_f32_le(self.rectifier_temp);
25240 __tmp.put_f32_le(self.generator_temp);
25241 __tmp.put_f32_le(self.efi_batt);
25242 __tmp.put_f32_le(self.efi_rpm);
25243 __tmp.put_f32_le(self.efi_pw);
25244 __tmp.put_f32_le(self.efi_fuel_flow);
25245 __tmp.put_f32_le(self.efi_fuel_consumed);
25246 __tmp.put_f32_le(self.efi_baro);
25247 __tmp.put_f32_le(self.efi_mat);
25248 __tmp.put_f32_le(self.efi_clt);
25249 __tmp.put_f32_le(self.efi_tps);
25250 __tmp.put_f32_le(self.efi_exhaust_gas_temperature);
25251 __tmp.put_u16_le(self.generator_status);
25252 __tmp.put_u16_le(self.efi_status);
25253 __tmp.put_u8(self.efi_index);
25254 if matches!(version, MavlinkVersion::V2) {
25255 let len = __tmp.len();
25256 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25257 } else {
25258 __tmp.len()
25259 }
25260 }
25261}
25262#[doc = "id: 191"]
25263#[doc = "Reports progress of compass calibration."]
25264#[derive(Debug, Clone, PartialEq)]
25265#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25267pub struct MAG_CAL_PROGRESS_DATA {
25268 #[doc = "Body frame direction vector for display."]
25269 pub direction_x: f32,
25270 #[doc = "Body frame direction vector for display."]
25271 pub direction_y: f32,
25272 #[doc = "Body frame direction vector for display."]
25273 pub direction_z: f32,
25274 #[doc = "Compass being calibrated."]
25275 pub compass_id: u8,
25276 #[doc = "Bitmask of compasses being calibrated."]
25277 pub cal_mask: u8,
25278 #[doc = "Calibration Status."]
25279 pub cal_status: MagCalStatus,
25280 #[doc = "Attempt number."]
25281 pub attempt: u8,
25282 #[doc = "Completion percentage."]
25283 pub completion_pct: u8,
25284 #[doc = "Bitmask of sphere sections (see <http://en.wikipedia.org/wiki/Geodesic_grid>)."]
25285 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25286 pub completion_mask: [u8; 10],
25287}
25288impl MAG_CAL_PROGRESS_DATA {
25289 pub const ENCODED_LEN: usize = 27usize;
25290 pub const DEFAULT: Self = Self {
25291 direction_x: 0.0_f32,
25292 direction_y: 0.0_f32,
25293 direction_z: 0.0_f32,
25294 compass_id: 0_u8,
25295 cal_mask: 0_u8,
25296 cal_status: MagCalStatus::DEFAULT,
25297 attempt: 0_u8,
25298 completion_pct: 0_u8,
25299 completion_mask: [0_u8; 10usize],
25300 };
25301 #[cfg(feature = "arbitrary")]
25302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25303 use arbitrary::{Arbitrary, Unstructured};
25304 let mut buf = [0u8; 1024];
25305 rng.fill_bytes(&mut buf);
25306 let mut unstructured = Unstructured::new(&buf);
25307 Self::arbitrary(&mut unstructured).unwrap_or_default()
25308 }
25309}
25310impl Default for MAG_CAL_PROGRESS_DATA {
25311 fn default() -> Self {
25312 Self::DEFAULT.clone()
25313 }
25314}
25315impl MessageData for MAG_CAL_PROGRESS_DATA {
25316 type Message = MavMessage;
25317 const ID: u32 = 191u32;
25318 const NAME: &'static str = "MAG_CAL_PROGRESS";
25319 const EXTRA_CRC: u8 = 92u8;
25320 const ENCODED_LEN: usize = 27usize;
25321 fn deser(
25322 _version: MavlinkVersion,
25323 __input: &[u8],
25324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25325 let avail_len = __input.len();
25326 let mut payload_buf = [0; Self::ENCODED_LEN];
25327 let mut buf = if avail_len < Self::ENCODED_LEN {
25328 payload_buf[0..avail_len].copy_from_slice(__input);
25329 Bytes::new(&payload_buf)
25330 } else {
25331 Bytes::new(__input)
25332 };
25333 let mut __struct = Self::default();
25334 __struct.direction_x = buf.get_f32_le();
25335 __struct.direction_y = buf.get_f32_le();
25336 __struct.direction_z = buf.get_f32_le();
25337 __struct.compass_id = buf.get_u8();
25338 __struct.cal_mask = buf.get_u8();
25339 let tmp = buf.get_u8();
25340 __struct.cal_status =
25341 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25342 enum_type: "MagCalStatus",
25343 value: tmp as u32,
25344 })?;
25345 __struct.attempt = buf.get_u8();
25346 __struct.completion_pct = buf.get_u8();
25347 for v in &mut __struct.completion_mask {
25348 let val = buf.get_u8();
25349 *v = val;
25350 }
25351 Ok(__struct)
25352 }
25353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25354 let mut __tmp = BytesMut::new(bytes);
25355 #[allow(clippy::absurd_extreme_comparisons)]
25356 #[allow(unused_comparisons)]
25357 if __tmp.remaining() < Self::ENCODED_LEN {
25358 panic!(
25359 "buffer is too small (need {} bytes, but got {})",
25360 Self::ENCODED_LEN,
25361 __tmp.remaining(),
25362 )
25363 }
25364 __tmp.put_f32_le(self.direction_x);
25365 __tmp.put_f32_le(self.direction_y);
25366 __tmp.put_f32_le(self.direction_z);
25367 __tmp.put_u8(self.compass_id);
25368 __tmp.put_u8(self.cal_mask);
25369 __tmp.put_u8(self.cal_status as u8);
25370 __tmp.put_u8(self.attempt);
25371 __tmp.put_u8(self.completion_pct);
25372 for val in &self.completion_mask {
25373 __tmp.put_u8(*val);
25374 }
25375 if matches!(version, MavlinkVersion::V2) {
25376 let len = __tmp.len();
25377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25378 } else {
25379 __tmp.len()
25380 }
25381 }
25382}
25383#[doc = "id: 192"]
25384#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
25385#[derive(Debug, Clone, PartialEq)]
25386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25388pub struct MAG_CAL_REPORT_DATA {
25389 #[doc = "RMS milligauss residuals."]
25390 pub fitness: f32,
25391 #[doc = "X offset."]
25392 pub ofs_x: f32,
25393 #[doc = "Y offset."]
25394 pub ofs_y: f32,
25395 #[doc = "Z offset."]
25396 pub ofs_z: f32,
25397 #[doc = "X diagonal (matrix 11)."]
25398 pub diag_x: f32,
25399 #[doc = "Y diagonal (matrix 22)."]
25400 pub diag_y: f32,
25401 #[doc = "Z diagonal (matrix 33)."]
25402 pub diag_z: f32,
25403 #[doc = "X off-diagonal (matrix 12 and 21)."]
25404 pub offdiag_x: f32,
25405 #[doc = "Y off-diagonal (matrix 13 and 31)."]
25406 pub offdiag_y: f32,
25407 #[doc = "Z off-diagonal (matrix 32 and 23)."]
25408 pub offdiag_z: f32,
25409 #[doc = "Compass being calibrated."]
25410 pub compass_id: u8,
25411 #[doc = "Bitmask of compasses being calibrated."]
25412 pub cal_mask: u8,
25413 #[doc = "Calibration Status."]
25414 pub cal_status: MagCalStatus,
25415 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
25416 pub autosaved: u8,
25417 #[doc = "Confidence in orientation (higher is better)."]
25418 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25419 pub orientation_confidence: f32,
25420 #[doc = "orientation before calibration."]
25421 #[cfg_attr(feature = "serde", serde(default))]
25422 pub old_orientation: MavSensorOrientation,
25423 #[doc = "orientation after calibration."]
25424 #[cfg_attr(feature = "serde", serde(default))]
25425 pub new_orientation: MavSensorOrientation,
25426 #[doc = "field radius correction factor"]
25427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25428 pub scale_factor: f32,
25429}
25430impl MAG_CAL_REPORT_DATA {
25431 pub const ENCODED_LEN: usize = 54usize;
25432 pub const DEFAULT: Self = Self {
25433 fitness: 0.0_f32,
25434 ofs_x: 0.0_f32,
25435 ofs_y: 0.0_f32,
25436 ofs_z: 0.0_f32,
25437 diag_x: 0.0_f32,
25438 diag_y: 0.0_f32,
25439 diag_z: 0.0_f32,
25440 offdiag_x: 0.0_f32,
25441 offdiag_y: 0.0_f32,
25442 offdiag_z: 0.0_f32,
25443 compass_id: 0_u8,
25444 cal_mask: 0_u8,
25445 cal_status: MagCalStatus::DEFAULT,
25446 autosaved: 0_u8,
25447 orientation_confidence: 0.0_f32,
25448 old_orientation: MavSensorOrientation::DEFAULT,
25449 new_orientation: MavSensorOrientation::DEFAULT,
25450 scale_factor: 0.0_f32,
25451 };
25452 #[cfg(feature = "arbitrary")]
25453 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25454 use arbitrary::{Arbitrary, Unstructured};
25455 let mut buf = [0u8; 1024];
25456 rng.fill_bytes(&mut buf);
25457 let mut unstructured = Unstructured::new(&buf);
25458 Self::arbitrary(&mut unstructured).unwrap_or_default()
25459 }
25460}
25461impl Default for MAG_CAL_REPORT_DATA {
25462 fn default() -> Self {
25463 Self::DEFAULT.clone()
25464 }
25465}
25466impl MessageData for MAG_CAL_REPORT_DATA {
25467 type Message = MavMessage;
25468 const ID: u32 = 192u32;
25469 const NAME: &'static str = "MAG_CAL_REPORT";
25470 const EXTRA_CRC: u8 = 36u8;
25471 const ENCODED_LEN: usize = 54usize;
25472 fn deser(
25473 _version: MavlinkVersion,
25474 __input: &[u8],
25475 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25476 let avail_len = __input.len();
25477 let mut payload_buf = [0; Self::ENCODED_LEN];
25478 let mut buf = if avail_len < Self::ENCODED_LEN {
25479 payload_buf[0..avail_len].copy_from_slice(__input);
25480 Bytes::new(&payload_buf)
25481 } else {
25482 Bytes::new(__input)
25483 };
25484 let mut __struct = Self::default();
25485 __struct.fitness = buf.get_f32_le();
25486 __struct.ofs_x = buf.get_f32_le();
25487 __struct.ofs_y = buf.get_f32_le();
25488 __struct.ofs_z = buf.get_f32_le();
25489 __struct.diag_x = buf.get_f32_le();
25490 __struct.diag_y = buf.get_f32_le();
25491 __struct.diag_z = buf.get_f32_le();
25492 __struct.offdiag_x = buf.get_f32_le();
25493 __struct.offdiag_y = buf.get_f32_le();
25494 __struct.offdiag_z = buf.get_f32_le();
25495 __struct.compass_id = buf.get_u8();
25496 __struct.cal_mask = buf.get_u8();
25497 let tmp = buf.get_u8();
25498 __struct.cal_status =
25499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25500 enum_type: "MagCalStatus",
25501 value: tmp as u32,
25502 })?;
25503 __struct.autosaved = buf.get_u8();
25504 __struct.orientation_confidence = buf.get_f32_le();
25505 let tmp = buf.get_u8();
25506 __struct.old_orientation =
25507 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25508 enum_type: "MavSensorOrientation",
25509 value: tmp as u32,
25510 })?;
25511 let tmp = buf.get_u8();
25512 __struct.new_orientation =
25513 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25514 enum_type: "MavSensorOrientation",
25515 value: tmp as u32,
25516 })?;
25517 __struct.scale_factor = buf.get_f32_le();
25518 Ok(__struct)
25519 }
25520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25521 let mut __tmp = BytesMut::new(bytes);
25522 #[allow(clippy::absurd_extreme_comparisons)]
25523 #[allow(unused_comparisons)]
25524 if __tmp.remaining() < Self::ENCODED_LEN {
25525 panic!(
25526 "buffer is too small (need {} bytes, but got {})",
25527 Self::ENCODED_LEN,
25528 __tmp.remaining(),
25529 )
25530 }
25531 __tmp.put_f32_le(self.fitness);
25532 __tmp.put_f32_le(self.ofs_x);
25533 __tmp.put_f32_le(self.ofs_y);
25534 __tmp.put_f32_le(self.ofs_z);
25535 __tmp.put_f32_le(self.diag_x);
25536 __tmp.put_f32_le(self.diag_y);
25537 __tmp.put_f32_le(self.diag_z);
25538 __tmp.put_f32_le(self.offdiag_x);
25539 __tmp.put_f32_le(self.offdiag_y);
25540 __tmp.put_f32_le(self.offdiag_z);
25541 __tmp.put_u8(self.compass_id);
25542 __tmp.put_u8(self.cal_mask);
25543 __tmp.put_u8(self.cal_status as u8);
25544 __tmp.put_u8(self.autosaved);
25545 __tmp.put_f32_le(self.orientation_confidence);
25546 __tmp.put_u8(self.old_orientation as u8);
25547 __tmp.put_u8(self.new_orientation as u8);
25548 __tmp.put_f32_le(self.scale_factor);
25549 if matches!(version, MavlinkVersion::V2) {
25550 let len = __tmp.len();
25551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25552 } else {
25553 __tmp.len()
25554 }
25555 }
25556}
25557#[doc = "id: 69"]
25558#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
25559#[derive(Debug, Clone, PartialEq)]
25560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25562pub struct MANUAL_CONTROL_DATA {
25563 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
25564 pub x: i16,
25565 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
25566 pub y: i16,
25567 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
25568 pub z: i16,
25569 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
25570 pub r: i16,
25571 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
25572 pub buttons: u16,
25573 #[doc = "The system to be controlled."]
25574 pub target: u8,
25575 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
25576 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25577 pub buttons2: u16,
25578 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
25579 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25580 pub enabled_extensions: u8,
25581 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
25582 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25583 pub s: i16,
25584 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
25585 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25586 pub t: i16,
25587 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
25588 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25589 pub aux1: i16,
25590 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
25591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25592 pub aux2: i16,
25593 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
25594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25595 pub aux3: i16,
25596 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
25597 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25598 pub aux4: i16,
25599 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
25600 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25601 pub aux5: i16,
25602 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
25603 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25604 pub aux6: i16,
25605}
25606impl MANUAL_CONTROL_DATA {
25607 pub const ENCODED_LEN: usize = 30usize;
25608 pub const DEFAULT: Self = Self {
25609 x: 0_i16,
25610 y: 0_i16,
25611 z: 0_i16,
25612 r: 0_i16,
25613 buttons: 0_u16,
25614 target: 0_u8,
25615 buttons2: 0_u16,
25616 enabled_extensions: 0_u8,
25617 s: 0_i16,
25618 t: 0_i16,
25619 aux1: 0_i16,
25620 aux2: 0_i16,
25621 aux3: 0_i16,
25622 aux4: 0_i16,
25623 aux5: 0_i16,
25624 aux6: 0_i16,
25625 };
25626 #[cfg(feature = "arbitrary")]
25627 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25628 use arbitrary::{Arbitrary, Unstructured};
25629 let mut buf = [0u8; 1024];
25630 rng.fill_bytes(&mut buf);
25631 let mut unstructured = Unstructured::new(&buf);
25632 Self::arbitrary(&mut unstructured).unwrap_or_default()
25633 }
25634}
25635impl Default for MANUAL_CONTROL_DATA {
25636 fn default() -> Self {
25637 Self::DEFAULT.clone()
25638 }
25639}
25640impl MessageData for MANUAL_CONTROL_DATA {
25641 type Message = MavMessage;
25642 const ID: u32 = 69u32;
25643 const NAME: &'static str = "MANUAL_CONTROL";
25644 const EXTRA_CRC: u8 = 243u8;
25645 const ENCODED_LEN: usize = 30usize;
25646 fn deser(
25647 _version: MavlinkVersion,
25648 __input: &[u8],
25649 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25650 let avail_len = __input.len();
25651 let mut payload_buf = [0; Self::ENCODED_LEN];
25652 let mut buf = if avail_len < Self::ENCODED_LEN {
25653 payload_buf[0..avail_len].copy_from_slice(__input);
25654 Bytes::new(&payload_buf)
25655 } else {
25656 Bytes::new(__input)
25657 };
25658 let mut __struct = Self::default();
25659 __struct.x = buf.get_i16_le();
25660 __struct.y = buf.get_i16_le();
25661 __struct.z = buf.get_i16_le();
25662 __struct.r = buf.get_i16_le();
25663 __struct.buttons = buf.get_u16_le();
25664 __struct.target = buf.get_u8();
25665 __struct.buttons2 = buf.get_u16_le();
25666 __struct.enabled_extensions = buf.get_u8();
25667 __struct.s = buf.get_i16_le();
25668 __struct.t = buf.get_i16_le();
25669 __struct.aux1 = buf.get_i16_le();
25670 __struct.aux2 = buf.get_i16_le();
25671 __struct.aux3 = buf.get_i16_le();
25672 __struct.aux4 = buf.get_i16_le();
25673 __struct.aux5 = buf.get_i16_le();
25674 __struct.aux6 = buf.get_i16_le();
25675 Ok(__struct)
25676 }
25677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25678 let mut __tmp = BytesMut::new(bytes);
25679 #[allow(clippy::absurd_extreme_comparisons)]
25680 #[allow(unused_comparisons)]
25681 if __tmp.remaining() < Self::ENCODED_LEN {
25682 panic!(
25683 "buffer is too small (need {} bytes, but got {})",
25684 Self::ENCODED_LEN,
25685 __tmp.remaining(),
25686 )
25687 }
25688 __tmp.put_i16_le(self.x);
25689 __tmp.put_i16_le(self.y);
25690 __tmp.put_i16_le(self.z);
25691 __tmp.put_i16_le(self.r);
25692 __tmp.put_u16_le(self.buttons);
25693 __tmp.put_u8(self.target);
25694 __tmp.put_u16_le(self.buttons2);
25695 __tmp.put_u8(self.enabled_extensions);
25696 __tmp.put_i16_le(self.s);
25697 __tmp.put_i16_le(self.t);
25698 __tmp.put_i16_le(self.aux1);
25699 __tmp.put_i16_le(self.aux2);
25700 __tmp.put_i16_le(self.aux3);
25701 __tmp.put_i16_le(self.aux4);
25702 __tmp.put_i16_le(self.aux5);
25703 __tmp.put_i16_le(self.aux6);
25704 if matches!(version, MavlinkVersion::V2) {
25705 let len = __tmp.len();
25706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25707 } else {
25708 __tmp.len()
25709 }
25710 }
25711}
25712#[doc = "id: 81"]
25713#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
25714#[derive(Debug, Clone, PartialEq)]
25715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25717pub struct MANUAL_SETPOINT_DATA {
25718 #[doc = "Timestamp (time since system boot)."]
25719 pub time_boot_ms: u32,
25720 #[doc = "Desired roll rate"]
25721 pub roll: f32,
25722 #[doc = "Desired pitch rate"]
25723 pub pitch: f32,
25724 #[doc = "Desired yaw rate"]
25725 pub yaw: f32,
25726 #[doc = "Collective thrust, normalized to 0 .. 1"]
25727 pub thrust: f32,
25728 #[doc = "Flight mode switch position, 0.. 255"]
25729 pub mode_switch: u8,
25730 #[doc = "Override mode switch position, 0.. 255"]
25731 pub manual_override_switch: u8,
25732}
25733impl MANUAL_SETPOINT_DATA {
25734 pub const ENCODED_LEN: usize = 22usize;
25735 pub const DEFAULT: Self = Self {
25736 time_boot_ms: 0_u32,
25737 roll: 0.0_f32,
25738 pitch: 0.0_f32,
25739 yaw: 0.0_f32,
25740 thrust: 0.0_f32,
25741 mode_switch: 0_u8,
25742 manual_override_switch: 0_u8,
25743 };
25744 #[cfg(feature = "arbitrary")]
25745 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25746 use arbitrary::{Arbitrary, Unstructured};
25747 let mut buf = [0u8; 1024];
25748 rng.fill_bytes(&mut buf);
25749 let mut unstructured = Unstructured::new(&buf);
25750 Self::arbitrary(&mut unstructured).unwrap_or_default()
25751 }
25752}
25753impl Default for MANUAL_SETPOINT_DATA {
25754 fn default() -> Self {
25755 Self::DEFAULT.clone()
25756 }
25757}
25758impl MessageData for MANUAL_SETPOINT_DATA {
25759 type Message = MavMessage;
25760 const ID: u32 = 81u32;
25761 const NAME: &'static str = "MANUAL_SETPOINT";
25762 const EXTRA_CRC: u8 = 106u8;
25763 const ENCODED_LEN: usize = 22usize;
25764 fn deser(
25765 _version: MavlinkVersion,
25766 __input: &[u8],
25767 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25768 let avail_len = __input.len();
25769 let mut payload_buf = [0; Self::ENCODED_LEN];
25770 let mut buf = if avail_len < Self::ENCODED_LEN {
25771 payload_buf[0..avail_len].copy_from_slice(__input);
25772 Bytes::new(&payload_buf)
25773 } else {
25774 Bytes::new(__input)
25775 };
25776 let mut __struct = Self::default();
25777 __struct.time_boot_ms = buf.get_u32_le();
25778 __struct.roll = buf.get_f32_le();
25779 __struct.pitch = buf.get_f32_le();
25780 __struct.yaw = buf.get_f32_le();
25781 __struct.thrust = buf.get_f32_le();
25782 __struct.mode_switch = buf.get_u8();
25783 __struct.manual_override_switch = buf.get_u8();
25784 Ok(__struct)
25785 }
25786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25787 let mut __tmp = BytesMut::new(bytes);
25788 #[allow(clippy::absurd_extreme_comparisons)]
25789 #[allow(unused_comparisons)]
25790 if __tmp.remaining() < Self::ENCODED_LEN {
25791 panic!(
25792 "buffer is too small (need {} bytes, but got {})",
25793 Self::ENCODED_LEN,
25794 __tmp.remaining(),
25795 )
25796 }
25797 __tmp.put_u32_le(self.time_boot_ms);
25798 __tmp.put_f32_le(self.roll);
25799 __tmp.put_f32_le(self.pitch);
25800 __tmp.put_f32_le(self.yaw);
25801 __tmp.put_f32_le(self.thrust);
25802 __tmp.put_u8(self.mode_switch);
25803 __tmp.put_u8(self.manual_override_switch);
25804 if matches!(version, MavlinkVersion::V2) {
25805 let len = __tmp.len();
25806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25807 } else {
25808 __tmp.len()
25809 }
25810 }
25811}
25812#[doc = "id: 11039"]
25813#[doc = "The MCU status, giving MCU temperature and voltage. The min and max voltages are to allow for detecting power supply instability."]
25814#[derive(Debug, Clone, PartialEq)]
25815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25817pub struct MCU_STATUS_DATA {
25818 #[doc = "MCU Internal temperature"]
25819 pub MCU_temperature: i16,
25820 #[doc = "MCU voltage"]
25821 pub MCU_voltage: u16,
25822 #[doc = "MCU voltage minimum"]
25823 pub MCU_voltage_min: u16,
25824 #[doc = "MCU voltage maximum"]
25825 pub MCU_voltage_max: u16,
25826 #[doc = "MCU instance"]
25827 pub id: u8,
25828}
25829impl MCU_STATUS_DATA {
25830 pub const ENCODED_LEN: usize = 9usize;
25831 pub const DEFAULT: Self = Self {
25832 MCU_temperature: 0_i16,
25833 MCU_voltage: 0_u16,
25834 MCU_voltage_min: 0_u16,
25835 MCU_voltage_max: 0_u16,
25836 id: 0_u8,
25837 };
25838 #[cfg(feature = "arbitrary")]
25839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25840 use arbitrary::{Arbitrary, Unstructured};
25841 let mut buf = [0u8; 1024];
25842 rng.fill_bytes(&mut buf);
25843 let mut unstructured = Unstructured::new(&buf);
25844 Self::arbitrary(&mut unstructured).unwrap_or_default()
25845 }
25846}
25847impl Default for MCU_STATUS_DATA {
25848 fn default() -> Self {
25849 Self::DEFAULT.clone()
25850 }
25851}
25852impl MessageData for MCU_STATUS_DATA {
25853 type Message = MavMessage;
25854 const ID: u32 = 11039u32;
25855 const NAME: &'static str = "MCU_STATUS";
25856 const EXTRA_CRC: u8 = 142u8;
25857 const ENCODED_LEN: usize = 9usize;
25858 fn deser(
25859 _version: MavlinkVersion,
25860 __input: &[u8],
25861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25862 let avail_len = __input.len();
25863 let mut payload_buf = [0; Self::ENCODED_LEN];
25864 let mut buf = if avail_len < Self::ENCODED_LEN {
25865 payload_buf[0..avail_len].copy_from_slice(__input);
25866 Bytes::new(&payload_buf)
25867 } else {
25868 Bytes::new(__input)
25869 };
25870 let mut __struct = Self::default();
25871 __struct.MCU_temperature = buf.get_i16_le();
25872 __struct.MCU_voltage = buf.get_u16_le();
25873 __struct.MCU_voltage_min = buf.get_u16_le();
25874 __struct.MCU_voltage_max = buf.get_u16_le();
25875 __struct.id = buf.get_u8();
25876 Ok(__struct)
25877 }
25878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25879 let mut __tmp = BytesMut::new(bytes);
25880 #[allow(clippy::absurd_extreme_comparisons)]
25881 #[allow(unused_comparisons)]
25882 if __tmp.remaining() < Self::ENCODED_LEN {
25883 panic!(
25884 "buffer is too small (need {} bytes, but got {})",
25885 Self::ENCODED_LEN,
25886 __tmp.remaining(),
25887 )
25888 }
25889 __tmp.put_i16_le(self.MCU_temperature);
25890 __tmp.put_u16_le(self.MCU_voltage);
25891 __tmp.put_u16_le(self.MCU_voltage_min);
25892 __tmp.put_u16_le(self.MCU_voltage_max);
25893 __tmp.put_u8(self.id);
25894 if matches!(version, MavlinkVersion::V2) {
25895 let len = __tmp.len();
25896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25897 } else {
25898 __tmp.len()
25899 }
25900 }
25901}
25902#[doc = "id: 152"]
25903#[doc = "State of autopilot RAM."]
25904#[derive(Debug, Clone, PartialEq)]
25905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25907pub struct MEMINFO_DATA {
25908 #[doc = "Heap top."]
25909 pub brkval: u16,
25910 #[doc = "Free memory."]
25911 pub freemem: u16,
25912 #[doc = "Free memory (32 bit)."]
25913 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25914 pub freemem32: u32,
25915}
25916impl MEMINFO_DATA {
25917 pub const ENCODED_LEN: usize = 8usize;
25918 pub const DEFAULT: Self = Self {
25919 brkval: 0_u16,
25920 freemem: 0_u16,
25921 freemem32: 0_u32,
25922 };
25923 #[cfg(feature = "arbitrary")]
25924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25925 use arbitrary::{Arbitrary, Unstructured};
25926 let mut buf = [0u8; 1024];
25927 rng.fill_bytes(&mut buf);
25928 let mut unstructured = Unstructured::new(&buf);
25929 Self::arbitrary(&mut unstructured).unwrap_or_default()
25930 }
25931}
25932impl Default for MEMINFO_DATA {
25933 fn default() -> Self {
25934 Self::DEFAULT.clone()
25935 }
25936}
25937impl MessageData for MEMINFO_DATA {
25938 type Message = MavMessage;
25939 const ID: u32 = 152u32;
25940 const NAME: &'static str = "MEMINFO";
25941 const EXTRA_CRC: u8 = 208u8;
25942 const ENCODED_LEN: usize = 8usize;
25943 fn deser(
25944 _version: MavlinkVersion,
25945 __input: &[u8],
25946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25947 let avail_len = __input.len();
25948 let mut payload_buf = [0; Self::ENCODED_LEN];
25949 let mut buf = if avail_len < Self::ENCODED_LEN {
25950 payload_buf[0..avail_len].copy_from_slice(__input);
25951 Bytes::new(&payload_buf)
25952 } else {
25953 Bytes::new(__input)
25954 };
25955 let mut __struct = Self::default();
25956 __struct.brkval = buf.get_u16_le();
25957 __struct.freemem = buf.get_u16_le();
25958 __struct.freemem32 = buf.get_u32_le();
25959 Ok(__struct)
25960 }
25961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25962 let mut __tmp = BytesMut::new(bytes);
25963 #[allow(clippy::absurd_extreme_comparisons)]
25964 #[allow(unused_comparisons)]
25965 if __tmp.remaining() < Self::ENCODED_LEN {
25966 panic!(
25967 "buffer is too small (need {} bytes, but got {})",
25968 Self::ENCODED_LEN,
25969 __tmp.remaining(),
25970 )
25971 }
25972 __tmp.put_u16_le(self.brkval);
25973 __tmp.put_u16_le(self.freemem);
25974 __tmp.put_u32_le(self.freemem32);
25975 if matches!(version, MavlinkVersion::V2) {
25976 let len = __tmp.len();
25977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25978 } else {
25979 __tmp.len()
25980 }
25981 }
25982}
25983#[doc = "id: 249"]
25984#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
25985#[derive(Debug, Clone, PartialEq)]
25986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25988pub struct MEMORY_VECT_DATA {
25989 #[doc = "Starting address of the debug variables"]
25990 pub address: u16,
25991 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
25992 pub ver: u8,
25993 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
25994 pub mavtype: u8,
25995 #[doc = "Memory contents at specified address"]
25996 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25997 pub value: [i8; 32],
25998}
25999impl MEMORY_VECT_DATA {
26000 pub const ENCODED_LEN: usize = 36usize;
26001 pub const DEFAULT: Self = Self {
26002 address: 0_u16,
26003 ver: 0_u8,
26004 mavtype: 0_u8,
26005 value: [0_i8; 32usize],
26006 };
26007 #[cfg(feature = "arbitrary")]
26008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26009 use arbitrary::{Arbitrary, Unstructured};
26010 let mut buf = [0u8; 1024];
26011 rng.fill_bytes(&mut buf);
26012 let mut unstructured = Unstructured::new(&buf);
26013 Self::arbitrary(&mut unstructured).unwrap_or_default()
26014 }
26015}
26016impl Default for MEMORY_VECT_DATA {
26017 fn default() -> Self {
26018 Self::DEFAULT.clone()
26019 }
26020}
26021impl MessageData for MEMORY_VECT_DATA {
26022 type Message = MavMessage;
26023 const ID: u32 = 249u32;
26024 const NAME: &'static str = "MEMORY_VECT";
26025 const EXTRA_CRC: u8 = 204u8;
26026 const ENCODED_LEN: usize = 36usize;
26027 fn deser(
26028 _version: MavlinkVersion,
26029 __input: &[u8],
26030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26031 let avail_len = __input.len();
26032 let mut payload_buf = [0; Self::ENCODED_LEN];
26033 let mut buf = if avail_len < Self::ENCODED_LEN {
26034 payload_buf[0..avail_len].copy_from_slice(__input);
26035 Bytes::new(&payload_buf)
26036 } else {
26037 Bytes::new(__input)
26038 };
26039 let mut __struct = Self::default();
26040 __struct.address = buf.get_u16_le();
26041 __struct.ver = buf.get_u8();
26042 __struct.mavtype = buf.get_u8();
26043 for v in &mut __struct.value {
26044 let val = buf.get_i8();
26045 *v = val;
26046 }
26047 Ok(__struct)
26048 }
26049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26050 let mut __tmp = BytesMut::new(bytes);
26051 #[allow(clippy::absurd_extreme_comparisons)]
26052 #[allow(unused_comparisons)]
26053 if __tmp.remaining() < Self::ENCODED_LEN {
26054 panic!(
26055 "buffer is too small (need {} bytes, but got {})",
26056 Self::ENCODED_LEN,
26057 __tmp.remaining(),
26058 )
26059 }
26060 __tmp.put_u16_le(self.address);
26061 __tmp.put_u8(self.ver);
26062 __tmp.put_u8(self.mavtype);
26063 for val in &self.value {
26064 __tmp.put_i8(*val);
26065 }
26066 if matches!(version, MavlinkVersion::V2) {
26067 let len = __tmp.len();
26068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26069 } else {
26070 __tmp.len()
26071 }
26072 }
26073}
26074#[doc = "id: 244"]
26075#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
26076#[derive(Debug, Clone, PartialEq)]
26077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26079pub struct MESSAGE_INTERVAL_DATA {
26080 #[doc = "0 indicates the interval at which it is sent."]
26081 pub interval_us: i32,
26082 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
26083 pub message_id: u16,
26084}
26085impl MESSAGE_INTERVAL_DATA {
26086 pub const ENCODED_LEN: usize = 6usize;
26087 pub const DEFAULT: Self = Self {
26088 interval_us: 0_i32,
26089 message_id: 0_u16,
26090 };
26091 #[cfg(feature = "arbitrary")]
26092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26093 use arbitrary::{Arbitrary, Unstructured};
26094 let mut buf = [0u8; 1024];
26095 rng.fill_bytes(&mut buf);
26096 let mut unstructured = Unstructured::new(&buf);
26097 Self::arbitrary(&mut unstructured).unwrap_or_default()
26098 }
26099}
26100impl Default for MESSAGE_INTERVAL_DATA {
26101 fn default() -> Self {
26102 Self::DEFAULT.clone()
26103 }
26104}
26105impl MessageData for MESSAGE_INTERVAL_DATA {
26106 type Message = MavMessage;
26107 const ID: u32 = 244u32;
26108 const NAME: &'static str = "MESSAGE_INTERVAL";
26109 const EXTRA_CRC: u8 = 95u8;
26110 const ENCODED_LEN: usize = 6usize;
26111 fn deser(
26112 _version: MavlinkVersion,
26113 __input: &[u8],
26114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26115 let avail_len = __input.len();
26116 let mut payload_buf = [0; Self::ENCODED_LEN];
26117 let mut buf = if avail_len < Self::ENCODED_LEN {
26118 payload_buf[0..avail_len].copy_from_slice(__input);
26119 Bytes::new(&payload_buf)
26120 } else {
26121 Bytes::new(__input)
26122 };
26123 let mut __struct = Self::default();
26124 __struct.interval_us = buf.get_i32_le();
26125 __struct.message_id = buf.get_u16_le();
26126 Ok(__struct)
26127 }
26128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26129 let mut __tmp = BytesMut::new(bytes);
26130 #[allow(clippy::absurd_extreme_comparisons)]
26131 #[allow(unused_comparisons)]
26132 if __tmp.remaining() < Self::ENCODED_LEN {
26133 panic!(
26134 "buffer is too small (need {} bytes, but got {})",
26135 Self::ENCODED_LEN,
26136 __tmp.remaining(),
26137 )
26138 }
26139 __tmp.put_i32_le(self.interval_us);
26140 __tmp.put_u16_le(self.message_id);
26141 if matches!(version, MavlinkVersion::V2) {
26142 let len = __tmp.len();
26143 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26144 } else {
26145 __tmp.len()
26146 }
26147 }
26148}
26149#[doc = "id: 47"]
26150#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
26151#[derive(Debug, Clone, PartialEq)]
26152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26154pub struct MISSION_ACK_DATA {
26155 #[doc = "System ID"]
26156 pub target_system: u8,
26157 #[doc = "Component ID"]
26158 pub target_component: u8,
26159 #[doc = "Mission result."]
26160 pub mavtype: MavMissionResult,
26161 #[doc = "Mission type."]
26162 #[cfg_attr(feature = "serde", serde(default))]
26163 pub mission_type: MavMissionType,
26164 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
26165 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26166 pub opaque_id: u32,
26167}
26168impl MISSION_ACK_DATA {
26169 pub const ENCODED_LEN: usize = 8usize;
26170 pub const DEFAULT: Self = Self {
26171 target_system: 0_u8,
26172 target_component: 0_u8,
26173 mavtype: MavMissionResult::DEFAULT,
26174 mission_type: MavMissionType::DEFAULT,
26175 opaque_id: 0_u32,
26176 };
26177 #[cfg(feature = "arbitrary")]
26178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26179 use arbitrary::{Arbitrary, Unstructured};
26180 let mut buf = [0u8; 1024];
26181 rng.fill_bytes(&mut buf);
26182 let mut unstructured = Unstructured::new(&buf);
26183 Self::arbitrary(&mut unstructured).unwrap_or_default()
26184 }
26185}
26186impl Default for MISSION_ACK_DATA {
26187 fn default() -> Self {
26188 Self::DEFAULT.clone()
26189 }
26190}
26191impl MessageData for MISSION_ACK_DATA {
26192 type Message = MavMessage;
26193 const ID: u32 = 47u32;
26194 const NAME: &'static str = "MISSION_ACK";
26195 const EXTRA_CRC: u8 = 153u8;
26196 const ENCODED_LEN: usize = 8usize;
26197 fn deser(
26198 _version: MavlinkVersion,
26199 __input: &[u8],
26200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26201 let avail_len = __input.len();
26202 let mut payload_buf = [0; Self::ENCODED_LEN];
26203 let mut buf = if avail_len < Self::ENCODED_LEN {
26204 payload_buf[0..avail_len].copy_from_slice(__input);
26205 Bytes::new(&payload_buf)
26206 } else {
26207 Bytes::new(__input)
26208 };
26209 let mut __struct = Self::default();
26210 __struct.target_system = buf.get_u8();
26211 __struct.target_component = buf.get_u8();
26212 let tmp = buf.get_u8();
26213 __struct.mavtype =
26214 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26215 enum_type: "MavMissionResult",
26216 value: tmp as u32,
26217 })?;
26218 let tmp = buf.get_u8();
26219 __struct.mission_type =
26220 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26221 enum_type: "MavMissionType",
26222 value: tmp as u32,
26223 })?;
26224 __struct.opaque_id = buf.get_u32_le();
26225 Ok(__struct)
26226 }
26227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26228 let mut __tmp = BytesMut::new(bytes);
26229 #[allow(clippy::absurd_extreme_comparisons)]
26230 #[allow(unused_comparisons)]
26231 if __tmp.remaining() < Self::ENCODED_LEN {
26232 panic!(
26233 "buffer is too small (need {} bytes, but got {})",
26234 Self::ENCODED_LEN,
26235 __tmp.remaining(),
26236 )
26237 }
26238 __tmp.put_u8(self.target_system);
26239 __tmp.put_u8(self.target_component);
26240 __tmp.put_u8(self.mavtype as u8);
26241 __tmp.put_u8(self.mission_type as u8);
26242 __tmp.put_u32_le(self.opaque_id);
26243 if matches!(version, MavlinkVersion::V2) {
26244 let len = __tmp.len();
26245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26246 } else {
26247 __tmp.len()
26248 }
26249 }
26250}
26251#[doc = "id: 45"]
26252#[doc = "Delete all mission items at once."]
26253#[derive(Debug, Clone, PartialEq)]
26254#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26256pub struct MISSION_CLEAR_ALL_DATA {
26257 #[doc = "System ID"]
26258 pub target_system: u8,
26259 #[doc = "Component ID"]
26260 pub target_component: u8,
26261 #[doc = "Mission type."]
26262 #[cfg_attr(feature = "serde", serde(default))]
26263 pub mission_type: MavMissionType,
26264}
26265impl MISSION_CLEAR_ALL_DATA {
26266 pub const ENCODED_LEN: usize = 3usize;
26267 pub const DEFAULT: Self = Self {
26268 target_system: 0_u8,
26269 target_component: 0_u8,
26270 mission_type: MavMissionType::DEFAULT,
26271 };
26272 #[cfg(feature = "arbitrary")]
26273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26274 use arbitrary::{Arbitrary, Unstructured};
26275 let mut buf = [0u8; 1024];
26276 rng.fill_bytes(&mut buf);
26277 let mut unstructured = Unstructured::new(&buf);
26278 Self::arbitrary(&mut unstructured).unwrap_or_default()
26279 }
26280}
26281impl Default for MISSION_CLEAR_ALL_DATA {
26282 fn default() -> Self {
26283 Self::DEFAULT.clone()
26284 }
26285}
26286impl MessageData for MISSION_CLEAR_ALL_DATA {
26287 type Message = MavMessage;
26288 const ID: u32 = 45u32;
26289 const NAME: &'static str = "MISSION_CLEAR_ALL";
26290 const EXTRA_CRC: u8 = 232u8;
26291 const ENCODED_LEN: usize = 3usize;
26292 fn deser(
26293 _version: MavlinkVersion,
26294 __input: &[u8],
26295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26296 let avail_len = __input.len();
26297 let mut payload_buf = [0; Self::ENCODED_LEN];
26298 let mut buf = if avail_len < Self::ENCODED_LEN {
26299 payload_buf[0..avail_len].copy_from_slice(__input);
26300 Bytes::new(&payload_buf)
26301 } else {
26302 Bytes::new(__input)
26303 };
26304 let mut __struct = Self::default();
26305 __struct.target_system = buf.get_u8();
26306 __struct.target_component = buf.get_u8();
26307 let tmp = buf.get_u8();
26308 __struct.mission_type =
26309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26310 enum_type: "MavMissionType",
26311 value: tmp as u32,
26312 })?;
26313 Ok(__struct)
26314 }
26315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26316 let mut __tmp = BytesMut::new(bytes);
26317 #[allow(clippy::absurd_extreme_comparisons)]
26318 #[allow(unused_comparisons)]
26319 if __tmp.remaining() < Self::ENCODED_LEN {
26320 panic!(
26321 "buffer is too small (need {} bytes, but got {})",
26322 Self::ENCODED_LEN,
26323 __tmp.remaining(),
26324 )
26325 }
26326 __tmp.put_u8(self.target_system);
26327 __tmp.put_u8(self.target_component);
26328 __tmp.put_u8(self.mission_type as u8);
26329 if matches!(version, MavlinkVersion::V2) {
26330 let len = __tmp.len();
26331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26332 } else {
26333 __tmp.len()
26334 }
26335 }
26336}
26337#[doc = "id: 44"]
26338#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
26339#[derive(Debug, Clone, PartialEq)]
26340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26342pub struct MISSION_COUNT_DATA {
26343 #[doc = "Number of mission items in the sequence"]
26344 pub count: u16,
26345 #[doc = "System ID"]
26346 pub target_system: u8,
26347 #[doc = "Component ID"]
26348 pub target_component: u8,
26349 #[doc = "Mission type."]
26350 #[cfg_attr(feature = "serde", serde(default))]
26351 pub mission_type: MavMissionType,
26352 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
26353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26354 pub opaque_id: u32,
26355}
26356impl MISSION_COUNT_DATA {
26357 pub const ENCODED_LEN: usize = 9usize;
26358 pub const DEFAULT: Self = Self {
26359 count: 0_u16,
26360 target_system: 0_u8,
26361 target_component: 0_u8,
26362 mission_type: MavMissionType::DEFAULT,
26363 opaque_id: 0_u32,
26364 };
26365 #[cfg(feature = "arbitrary")]
26366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26367 use arbitrary::{Arbitrary, Unstructured};
26368 let mut buf = [0u8; 1024];
26369 rng.fill_bytes(&mut buf);
26370 let mut unstructured = Unstructured::new(&buf);
26371 Self::arbitrary(&mut unstructured).unwrap_or_default()
26372 }
26373}
26374impl Default for MISSION_COUNT_DATA {
26375 fn default() -> Self {
26376 Self::DEFAULT.clone()
26377 }
26378}
26379impl MessageData for MISSION_COUNT_DATA {
26380 type Message = MavMessage;
26381 const ID: u32 = 44u32;
26382 const NAME: &'static str = "MISSION_COUNT";
26383 const EXTRA_CRC: u8 = 221u8;
26384 const ENCODED_LEN: usize = 9usize;
26385 fn deser(
26386 _version: MavlinkVersion,
26387 __input: &[u8],
26388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26389 let avail_len = __input.len();
26390 let mut payload_buf = [0; Self::ENCODED_LEN];
26391 let mut buf = if avail_len < Self::ENCODED_LEN {
26392 payload_buf[0..avail_len].copy_from_slice(__input);
26393 Bytes::new(&payload_buf)
26394 } else {
26395 Bytes::new(__input)
26396 };
26397 let mut __struct = Self::default();
26398 __struct.count = buf.get_u16_le();
26399 __struct.target_system = buf.get_u8();
26400 __struct.target_component = buf.get_u8();
26401 let tmp = buf.get_u8();
26402 __struct.mission_type =
26403 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26404 enum_type: "MavMissionType",
26405 value: tmp as u32,
26406 })?;
26407 __struct.opaque_id = buf.get_u32_le();
26408 Ok(__struct)
26409 }
26410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26411 let mut __tmp = BytesMut::new(bytes);
26412 #[allow(clippy::absurd_extreme_comparisons)]
26413 #[allow(unused_comparisons)]
26414 if __tmp.remaining() < Self::ENCODED_LEN {
26415 panic!(
26416 "buffer is too small (need {} bytes, but got {})",
26417 Self::ENCODED_LEN,
26418 __tmp.remaining(),
26419 )
26420 }
26421 __tmp.put_u16_le(self.count);
26422 __tmp.put_u8(self.target_system);
26423 __tmp.put_u8(self.target_component);
26424 __tmp.put_u8(self.mission_type as u8);
26425 __tmp.put_u32_le(self.opaque_id);
26426 if matches!(version, MavlinkVersion::V2) {
26427 let len = __tmp.len();
26428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26429 } else {
26430 __tmp.len()
26431 }
26432 }
26433}
26434#[doc = "id: 42"]
26435#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
26436#[derive(Debug, Clone, PartialEq)]
26437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26439pub struct MISSION_CURRENT_DATA {
26440 #[doc = "Sequence"]
26441 pub seq: u16,
26442 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
26443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26444 pub total: u16,
26445 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
26446 #[cfg_attr(feature = "serde", serde(default))]
26447 pub mission_state: MissionState,
26448 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
26449 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26450 pub mission_mode: u8,
26451 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
26452 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26453 pub mission_id: u32,
26454 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
26455 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26456 pub fence_id: u32,
26457 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
26458 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26459 pub rally_points_id: u32,
26460}
26461impl MISSION_CURRENT_DATA {
26462 pub const ENCODED_LEN: usize = 18usize;
26463 pub const DEFAULT: Self = Self {
26464 seq: 0_u16,
26465 total: 0_u16,
26466 mission_state: MissionState::DEFAULT,
26467 mission_mode: 0_u8,
26468 mission_id: 0_u32,
26469 fence_id: 0_u32,
26470 rally_points_id: 0_u32,
26471 };
26472 #[cfg(feature = "arbitrary")]
26473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26474 use arbitrary::{Arbitrary, Unstructured};
26475 let mut buf = [0u8; 1024];
26476 rng.fill_bytes(&mut buf);
26477 let mut unstructured = Unstructured::new(&buf);
26478 Self::arbitrary(&mut unstructured).unwrap_or_default()
26479 }
26480}
26481impl Default for MISSION_CURRENT_DATA {
26482 fn default() -> Self {
26483 Self::DEFAULT.clone()
26484 }
26485}
26486impl MessageData for MISSION_CURRENT_DATA {
26487 type Message = MavMessage;
26488 const ID: u32 = 42u32;
26489 const NAME: &'static str = "MISSION_CURRENT";
26490 const EXTRA_CRC: u8 = 28u8;
26491 const ENCODED_LEN: usize = 18usize;
26492 fn deser(
26493 _version: MavlinkVersion,
26494 __input: &[u8],
26495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26496 let avail_len = __input.len();
26497 let mut payload_buf = [0; Self::ENCODED_LEN];
26498 let mut buf = if avail_len < Self::ENCODED_LEN {
26499 payload_buf[0..avail_len].copy_from_slice(__input);
26500 Bytes::new(&payload_buf)
26501 } else {
26502 Bytes::new(__input)
26503 };
26504 let mut __struct = Self::default();
26505 __struct.seq = buf.get_u16_le();
26506 __struct.total = buf.get_u16_le();
26507 let tmp = buf.get_u8();
26508 __struct.mission_state =
26509 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26510 enum_type: "MissionState",
26511 value: tmp as u32,
26512 })?;
26513 __struct.mission_mode = buf.get_u8();
26514 __struct.mission_id = buf.get_u32_le();
26515 __struct.fence_id = buf.get_u32_le();
26516 __struct.rally_points_id = buf.get_u32_le();
26517 Ok(__struct)
26518 }
26519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26520 let mut __tmp = BytesMut::new(bytes);
26521 #[allow(clippy::absurd_extreme_comparisons)]
26522 #[allow(unused_comparisons)]
26523 if __tmp.remaining() < Self::ENCODED_LEN {
26524 panic!(
26525 "buffer is too small (need {} bytes, but got {})",
26526 Self::ENCODED_LEN,
26527 __tmp.remaining(),
26528 )
26529 }
26530 __tmp.put_u16_le(self.seq);
26531 __tmp.put_u16_le(self.total);
26532 __tmp.put_u8(self.mission_state as u8);
26533 __tmp.put_u8(self.mission_mode);
26534 __tmp.put_u32_le(self.mission_id);
26535 __tmp.put_u32_le(self.fence_id);
26536 __tmp.put_u32_le(self.rally_points_id);
26537 if matches!(version, MavlinkVersion::V2) {
26538 let len = __tmp.len();
26539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26540 } else {
26541 __tmp.len()
26542 }
26543 }
26544}
26545#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
26546#[doc = "id: 39"]
26547#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
26548#[derive(Debug, Clone, PartialEq)]
26549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26551pub struct MISSION_ITEM_DATA {
26552 #[doc = "PARAM1, see MAV_CMD enum"]
26553 pub param1: f32,
26554 #[doc = "PARAM2, see MAV_CMD enum"]
26555 pub param2: f32,
26556 #[doc = "PARAM3, see MAV_CMD enum"]
26557 pub param3: f32,
26558 #[doc = "PARAM4, see MAV_CMD enum"]
26559 pub param4: f32,
26560 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
26561 pub x: f32,
26562 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
26563 pub y: f32,
26564 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
26565 pub z: f32,
26566 #[doc = "Sequence"]
26567 pub seq: u16,
26568 #[doc = "The scheduled action for the waypoint."]
26569 pub command: MavCmd,
26570 #[doc = "System ID"]
26571 pub target_system: u8,
26572 #[doc = "Component ID"]
26573 pub target_component: u8,
26574 #[doc = "The coordinate system of the waypoint."]
26575 pub frame: MavFrame,
26576 #[doc = "false:0, true:1"]
26577 pub current: u8,
26578 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
26579 pub autocontinue: u8,
26580 #[doc = "Mission type."]
26581 #[cfg_attr(feature = "serde", serde(default))]
26582 pub mission_type: MavMissionType,
26583}
26584impl MISSION_ITEM_DATA {
26585 pub const ENCODED_LEN: usize = 38usize;
26586 pub const DEFAULT: Self = Self {
26587 param1: 0.0_f32,
26588 param2: 0.0_f32,
26589 param3: 0.0_f32,
26590 param4: 0.0_f32,
26591 x: 0.0_f32,
26592 y: 0.0_f32,
26593 z: 0.0_f32,
26594 seq: 0_u16,
26595 command: MavCmd::DEFAULT,
26596 target_system: 0_u8,
26597 target_component: 0_u8,
26598 frame: MavFrame::DEFAULT,
26599 current: 0_u8,
26600 autocontinue: 0_u8,
26601 mission_type: MavMissionType::DEFAULT,
26602 };
26603 #[cfg(feature = "arbitrary")]
26604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26605 use arbitrary::{Arbitrary, Unstructured};
26606 let mut buf = [0u8; 1024];
26607 rng.fill_bytes(&mut buf);
26608 let mut unstructured = Unstructured::new(&buf);
26609 Self::arbitrary(&mut unstructured).unwrap_or_default()
26610 }
26611}
26612impl Default for MISSION_ITEM_DATA {
26613 fn default() -> Self {
26614 Self::DEFAULT.clone()
26615 }
26616}
26617impl MessageData for MISSION_ITEM_DATA {
26618 type Message = MavMessage;
26619 const ID: u32 = 39u32;
26620 const NAME: &'static str = "MISSION_ITEM";
26621 const EXTRA_CRC: u8 = 254u8;
26622 const ENCODED_LEN: usize = 38usize;
26623 fn deser(
26624 _version: MavlinkVersion,
26625 __input: &[u8],
26626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26627 let avail_len = __input.len();
26628 let mut payload_buf = [0; Self::ENCODED_LEN];
26629 let mut buf = if avail_len < Self::ENCODED_LEN {
26630 payload_buf[0..avail_len].copy_from_slice(__input);
26631 Bytes::new(&payload_buf)
26632 } else {
26633 Bytes::new(__input)
26634 };
26635 let mut __struct = Self::default();
26636 __struct.param1 = buf.get_f32_le();
26637 __struct.param2 = buf.get_f32_le();
26638 __struct.param3 = buf.get_f32_le();
26639 __struct.param4 = buf.get_f32_le();
26640 __struct.x = buf.get_f32_le();
26641 __struct.y = buf.get_f32_le();
26642 __struct.z = buf.get_f32_le();
26643 __struct.seq = buf.get_u16_le();
26644 let tmp = buf.get_u16_le();
26645 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
26646 ::mavlink_core::error::ParserError::InvalidEnum {
26647 enum_type: "MavCmd",
26648 value: tmp as u32,
26649 },
26650 )?;
26651 __struct.target_system = buf.get_u8();
26652 __struct.target_component = buf.get_u8();
26653 let tmp = buf.get_u8();
26654 __struct.frame =
26655 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26656 enum_type: "MavFrame",
26657 value: tmp as u32,
26658 })?;
26659 __struct.current = buf.get_u8();
26660 __struct.autocontinue = buf.get_u8();
26661 let tmp = buf.get_u8();
26662 __struct.mission_type =
26663 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26664 enum_type: "MavMissionType",
26665 value: tmp as u32,
26666 })?;
26667 Ok(__struct)
26668 }
26669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26670 let mut __tmp = BytesMut::new(bytes);
26671 #[allow(clippy::absurd_extreme_comparisons)]
26672 #[allow(unused_comparisons)]
26673 if __tmp.remaining() < Self::ENCODED_LEN {
26674 panic!(
26675 "buffer is too small (need {} bytes, but got {})",
26676 Self::ENCODED_LEN,
26677 __tmp.remaining(),
26678 )
26679 }
26680 __tmp.put_f32_le(self.param1);
26681 __tmp.put_f32_le(self.param2);
26682 __tmp.put_f32_le(self.param3);
26683 __tmp.put_f32_le(self.param4);
26684 __tmp.put_f32_le(self.x);
26685 __tmp.put_f32_le(self.y);
26686 __tmp.put_f32_le(self.z);
26687 __tmp.put_u16_le(self.seq);
26688 __tmp.put_u16_le(self.command as u16);
26689 __tmp.put_u8(self.target_system);
26690 __tmp.put_u8(self.target_component);
26691 __tmp.put_u8(self.frame as u8);
26692 __tmp.put_u8(self.current);
26693 __tmp.put_u8(self.autocontinue);
26694 __tmp.put_u8(self.mission_type as u8);
26695 if matches!(version, MavlinkVersion::V2) {
26696 let len = __tmp.len();
26697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26698 } else {
26699 __tmp.len()
26700 }
26701 }
26702}
26703#[doc = "id: 73"]
26704#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
26705#[derive(Debug, Clone, PartialEq)]
26706#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26707#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26708pub struct MISSION_ITEM_INT_DATA {
26709 #[doc = "PARAM1, see MAV_CMD enum"]
26710 pub param1: f32,
26711 #[doc = "PARAM2, see MAV_CMD enum"]
26712 pub param2: f32,
26713 #[doc = "PARAM3, see MAV_CMD enum"]
26714 pub param3: f32,
26715 #[doc = "PARAM4, see MAV_CMD enum"]
26716 pub param4: f32,
26717 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
26718 pub x: i32,
26719 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
26720 pub y: i32,
26721 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
26722 pub z: f32,
26723 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
26724 pub seq: u16,
26725 #[doc = "The scheduled action for the waypoint."]
26726 pub command: MavCmd,
26727 #[doc = "System ID"]
26728 pub target_system: u8,
26729 #[doc = "Component ID"]
26730 pub target_component: u8,
26731 #[doc = "The coordinate system of the waypoint."]
26732 pub frame: MavFrame,
26733 #[doc = "false:0, true:1"]
26734 pub current: u8,
26735 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
26736 pub autocontinue: u8,
26737 #[doc = "Mission type."]
26738 #[cfg_attr(feature = "serde", serde(default))]
26739 pub mission_type: MavMissionType,
26740}
26741impl MISSION_ITEM_INT_DATA {
26742 pub const ENCODED_LEN: usize = 38usize;
26743 pub const DEFAULT: Self = Self {
26744 param1: 0.0_f32,
26745 param2: 0.0_f32,
26746 param3: 0.0_f32,
26747 param4: 0.0_f32,
26748 x: 0_i32,
26749 y: 0_i32,
26750 z: 0.0_f32,
26751 seq: 0_u16,
26752 command: MavCmd::DEFAULT,
26753 target_system: 0_u8,
26754 target_component: 0_u8,
26755 frame: MavFrame::DEFAULT,
26756 current: 0_u8,
26757 autocontinue: 0_u8,
26758 mission_type: MavMissionType::DEFAULT,
26759 };
26760 #[cfg(feature = "arbitrary")]
26761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26762 use arbitrary::{Arbitrary, Unstructured};
26763 let mut buf = [0u8; 1024];
26764 rng.fill_bytes(&mut buf);
26765 let mut unstructured = Unstructured::new(&buf);
26766 Self::arbitrary(&mut unstructured).unwrap_or_default()
26767 }
26768}
26769impl Default for MISSION_ITEM_INT_DATA {
26770 fn default() -> Self {
26771 Self::DEFAULT.clone()
26772 }
26773}
26774impl MessageData for MISSION_ITEM_INT_DATA {
26775 type Message = MavMessage;
26776 const ID: u32 = 73u32;
26777 const NAME: &'static str = "MISSION_ITEM_INT";
26778 const EXTRA_CRC: u8 = 38u8;
26779 const ENCODED_LEN: usize = 38usize;
26780 fn deser(
26781 _version: MavlinkVersion,
26782 __input: &[u8],
26783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26784 let avail_len = __input.len();
26785 let mut payload_buf = [0; Self::ENCODED_LEN];
26786 let mut buf = if avail_len < Self::ENCODED_LEN {
26787 payload_buf[0..avail_len].copy_from_slice(__input);
26788 Bytes::new(&payload_buf)
26789 } else {
26790 Bytes::new(__input)
26791 };
26792 let mut __struct = Self::default();
26793 __struct.param1 = buf.get_f32_le();
26794 __struct.param2 = buf.get_f32_le();
26795 __struct.param3 = buf.get_f32_le();
26796 __struct.param4 = buf.get_f32_le();
26797 __struct.x = buf.get_i32_le();
26798 __struct.y = buf.get_i32_le();
26799 __struct.z = buf.get_f32_le();
26800 __struct.seq = buf.get_u16_le();
26801 let tmp = buf.get_u16_le();
26802 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
26803 ::mavlink_core::error::ParserError::InvalidEnum {
26804 enum_type: "MavCmd",
26805 value: tmp as u32,
26806 },
26807 )?;
26808 __struct.target_system = buf.get_u8();
26809 __struct.target_component = buf.get_u8();
26810 let tmp = buf.get_u8();
26811 __struct.frame =
26812 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26813 enum_type: "MavFrame",
26814 value: tmp as u32,
26815 })?;
26816 __struct.current = buf.get_u8();
26817 __struct.autocontinue = buf.get_u8();
26818 let tmp = buf.get_u8();
26819 __struct.mission_type =
26820 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26821 enum_type: "MavMissionType",
26822 value: tmp as u32,
26823 })?;
26824 Ok(__struct)
26825 }
26826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26827 let mut __tmp = BytesMut::new(bytes);
26828 #[allow(clippy::absurd_extreme_comparisons)]
26829 #[allow(unused_comparisons)]
26830 if __tmp.remaining() < Self::ENCODED_LEN {
26831 panic!(
26832 "buffer is too small (need {} bytes, but got {})",
26833 Self::ENCODED_LEN,
26834 __tmp.remaining(),
26835 )
26836 }
26837 __tmp.put_f32_le(self.param1);
26838 __tmp.put_f32_le(self.param2);
26839 __tmp.put_f32_le(self.param3);
26840 __tmp.put_f32_le(self.param4);
26841 __tmp.put_i32_le(self.x);
26842 __tmp.put_i32_le(self.y);
26843 __tmp.put_f32_le(self.z);
26844 __tmp.put_u16_le(self.seq);
26845 __tmp.put_u16_le(self.command as u16);
26846 __tmp.put_u8(self.target_system);
26847 __tmp.put_u8(self.target_component);
26848 __tmp.put_u8(self.frame as u8);
26849 __tmp.put_u8(self.current);
26850 __tmp.put_u8(self.autocontinue);
26851 __tmp.put_u8(self.mission_type as u8);
26852 if matches!(version, MavlinkVersion::V2) {
26853 let len = __tmp.len();
26854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26855 } else {
26856 __tmp.len()
26857 }
26858 }
26859}
26860#[doc = "id: 46"]
26861#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
26862#[derive(Debug, Clone, PartialEq)]
26863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26865pub struct MISSION_ITEM_REACHED_DATA {
26866 #[doc = "Sequence"]
26867 pub seq: u16,
26868}
26869impl MISSION_ITEM_REACHED_DATA {
26870 pub const ENCODED_LEN: usize = 2usize;
26871 pub const DEFAULT: Self = Self { seq: 0_u16 };
26872 #[cfg(feature = "arbitrary")]
26873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26874 use arbitrary::{Arbitrary, Unstructured};
26875 let mut buf = [0u8; 1024];
26876 rng.fill_bytes(&mut buf);
26877 let mut unstructured = Unstructured::new(&buf);
26878 Self::arbitrary(&mut unstructured).unwrap_or_default()
26879 }
26880}
26881impl Default for MISSION_ITEM_REACHED_DATA {
26882 fn default() -> Self {
26883 Self::DEFAULT.clone()
26884 }
26885}
26886impl MessageData for MISSION_ITEM_REACHED_DATA {
26887 type Message = MavMessage;
26888 const ID: u32 = 46u32;
26889 const NAME: &'static str = "MISSION_ITEM_REACHED";
26890 const EXTRA_CRC: u8 = 11u8;
26891 const ENCODED_LEN: usize = 2usize;
26892 fn deser(
26893 _version: MavlinkVersion,
26894 __input: &[u8],
26895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26896 let avail_len = __input.len();
26897 let mut payload_buf = [0; Self::ENCODED_LEN];
26898 let mut buf = if avail_len < Self::ENCODED_LEN {
26899 payload_buf[0..avail_len].copy_from_slice(__input);
26900 Bytes::new(&payload_buf)
26901 } else {
26902 Bytes::new(__input)
26903 };
26904 let mut __struct = Self::default();
26905 __struct.seq = buf.get_u16_le();
26906 Ok(__struct)
26907 }
26908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26909 let mut __tmp = BytesMut::new(bytes);
26910 #[allow(clippy::absurd_extreme_comparisons)]
26911 #[allow(unused_comparisons)]
26912 if __tmp.remaining() < Self::ENCODED_LEN {
26913 panic!(
26914 "buffer is too small (need {} bytes, but got {})",
26915 Self::ENCODED_LEN,
26916 __tmp.remaining(),
26917 )
26918 }
26919 __tmp.put_u16_le(self.seq);
26920 if matches!(version, MavlinkVersion::V2) {
26921 let len = __tmp.len();
26922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26923 } else {
26924 __tmp.len()
26925 }
26926 }
26927}
26928#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
26929#[doc = "id: 40"]
26930#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
26931#[derive(Debug, Clone, PartialEq)]
26932#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26934pub struct MISSION_REQUEST_DATA {
26935 #[doc = "Sequence"]
26936 pub seq: u16,
26937 #[doc = "System ID"]
26938 pub target_system: u8,
26939 #[doc = "Component ID"]
26940 pub target_component: u8,
26941 #[doc = "Mission type."]
26942 #[cfg_attr(feature = "serde", serde(default))]
26943 pub mission_type: MavMissionType,
26944}
26945impl MISSION_REQUEST_DATA {
26946 pub const ENCODED_LEN: usize = 5usize;
26947 pub const DEFAULT: Self = Self {
26948 seq: 0_u16,
26949 target_system: 0_u8,
26950 target_component: 0_u8,
26951 mission_type: MavMissionType::DEFAULT,
26952 };
26953 #[cfg(feature = "arbitrary")]
26954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26955 use arbitrary::{Arbitrary, Unstructured};
26956 let mut buf = [0u8; 1024];
26957 rng.fill_bytes(&mut buf);
26958 let mut unstructured = Unstructured::new(&buf);
26959 Self::arbitrary(&mut unstructured).unwrap_or_default()
26960 }
26961}
26962impl Default for MISSION_REQUEST_DATA {
26963 fn default() -> Self {
26964 Self::DEFAULT.clone()
26965 }
26966}
26967impl MessageData for MISSION_REQUEST_DATA {
26968 type Message = MavMessage;
26969 const ID: u32 = 40u32;
26970 const NAME: &'static str = "MISSION_REQUEST";
26971 const EXTRA_CRC: u8 = 230u8;
26972 const ENCODED_LEN: usize = 5usize;
26973 fn deser(
26974 _version: MavlinkVersion,
26975 __input: &[u8],
26976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26977 let avail_len = __input.len();
26978 let mut payload_buf = [0; Self::ENCODED_LEN];
26979 let mut buf = if avail_len < Self::ENCODED_LEN {
26980 payload_buf[0..avail_len].copy_from_slice(__input);
26981 Bytes::new(&payload_buf)
26982 } else {
26983 Bytes::new(__input)
26984 };
26985 let mut __struct = Self::default();
26986 __struct.seq = buf.get_u16_le();
26987 __struct.target_system = buf.get_u8();
26988 __struct.target_component = buf.get_u8();
26989 let tmp = buf.get_u8();
26990 __struct.mission_type =
26991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26992 enum_type: "MavMissionType",
26993 value: tmp as u32,
26994 })?;
26995 Ok(__struct)
26996 }
26997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26998 let mut __tmp = BytesMut::new(bytes);
26999 #[allow(clippy::absurd_extreme_comparisons)]
27000 #[allow(unused_comparisons)]
27001 if __tmp.remaining() < Self::ENCODED_LEN {
27002 panic!(
27003 "buffer is too small (need {} bytes, but got {})",
27004 Self::ENCODED_LEN,
27005 __tmp.remaining(),
27006 )
27007 }
27008 __tmp.put_u16_le(self.seq);
27009 __tmp.put_u8(self.target_system);
27010 __tmp.put_u8(self.target_component);
27011 __tmp.put_u8(self.mission_type as u8);
27012 if matches!(version, MavlinkVersion::V2) {
27013 let len = __tmp.len();
27014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27015 } else {
27016 __tmp.len()
27017 }
27018 }
27019}
27020#[doc = "id: 51"]
27021#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
27022#[derive(Debug, Clone, PartialEq)]
27023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27025pub struct MISSION_REQUEST_INT_DATA {
27026 #[doc = "Sequence"]
27027 pub seq: u16,
27028 #[doc = "System ID"]
27029 pub target_system: u8,
27030 #[doc = "Component ID"]
27031 pub target_component: u8,
27032 #[doc = "Mission type."]
27033 #[cfg_attr(feature = "serde", serde(default))]
27034 pub mission_type: MavMissionType,
27035}
27036impl MISSION_REQUEST_INT_DATA {
27037 pub const ENCODED_LEN: usize = 5usize;
27038 pub const DEFAULT: Self = Self {
27039 seq: 0_u16,
27040 target_system: 0_u8,
27041 target_component: 0_u8,
27042 mission_type: MavMissionType::DEFAULT,
27043 };
27044 #[cfg(feature = "arbitrary")]
27045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27046 use arbitrary::{Arbitrary, Unstructured};
27047 let mut buf = [0u8; 1024];
27048 rng.fill_bytes(&mut buf);
27049 let mut unstructured = Unstructured::new(&buf);
27050 Self::arbitrary(&mut unstructured).unwrap_or_default()
27051 }
27052}
27053impl Default for MISSION_REQUEST_INT_DATA {
27054 fn default() -> Self {
27055 Self::DEFAULT.clone()
27056 }
27057}
27058impl MessageData for MISSION_REQUEST_INT_DATA {
27059 type Message = MavMessage;
27060 const ID: u32 = 51u32;
27061 const NAME: &'static str = "MISSION_REQUEST_INT";
27062 const EXTRA_CRC: u8 = 196u8;
27063 const ENCODED_LEN: usize = 5usize;
27064 fn deser(
27065 _version: MavlinkVersion,
27066 __input: &[u8],
27067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27068 let avail_len = __input.len();
27069 let mut payload_buf = [0; Self::ENCODED_LEN];
27070 let mut buf = if avail_len < Self::ENCODED_LEN {
27071 payload_buf[0..avail_len].copy_from_slice(__input);
27072 Bytes::new(&payload_buf)
27073 } else {
27074 Bytes::new(__input)
27075 };
27076 let mut __struct = Self::default();
27077 __struct.seq = buf.get_u16_le();
27078 __struct.target_system = buf.get_u8();
27079 __struct.target_component = buf.get_u8();
27080 let tmp = buf.get_u8();
27081 __struct.mission_type =
27082 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27083 enum_type: "MavMissionType",
27084 value: tmp as u32,
27085 })?;
27086 Ok(__struct)
27087 }
27088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27089 let mut __tmp = BytesMut::new(bytes);
27090 #[allow(clippy::absurd_extreme_comparisons)]
27091 #[allow(unused_comparisons)]
27092 if __tmp.remaining() < Self::ENCODED_LEN {
27093 panic!(
27094 "buffer is too small (need {} bytes, but got {})",
27095 Self::ENCODED_LEN,
27096 __tmp.remaining(),
27097 )
27098 }
27099 __tmp.put_u16_le(self.seq);
27100 __tmp.put_u8(self.target_system);
27101 __tmp.put_u8(self.target_component);
27102 __tmp.put_u8(self.mission_type as u8);
27103 if matches!(version, MavlinkVersion::V2) {
27104 let len = __tmp.len();
27105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27106 } else {
27107 __tmp.len()
27108 }
27109 }
27110}
27111#[doc = "id: 43"]
27112#[doc = "Request the overall list of mission items from the system/component."]
27113#[derive(Debug, Clone, PartialEq)]
27114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27116pub struct MISSION_REQUEST_LIST_DATA {
27117 #[doc = "System ID"]
27118 pub target_system: u8,
27119 #[doc = "Component ID"]
27120 pub target_component: u8,
27121 #[doc = "Mission type."]
27122 #[cfg_attr(feature = "serde", serde(default))]
27123 pub mission_type: MavMissionType,
27124}
27125impl MISSION_REQUEST_LIST_DATA {
27126 pub const ENCODED_LEN: usize = 3usize;
27127 pub const DEFAULT: Self = Self {
27128 target_system: 0_u8,
27129 target_component: 0_u8,
27130 mission_type: MavMissionType::DEFAULT,
27131 };
27132 #[cfg(feature = "arbitrary")]
27133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27134 use arbitrary::{Arbitrary, Unstructured};
27135 let mut buf = [0u8; 1024];
27136 rng.fill_bytes(&mut buf);
27137 let mut unstructured = Unstructured::new(&buf);
27138 Self::arbitrary(&mut unstructured).unwrap_or_default()
27139 }
27140}
27141impl Default for MISSION_REQUEST_LIST_DATA {
27142 fn default() -> Self {
27143 Self::DEFAULT.clone()
27144 }
27145}
27146impl MessageData for MISSION_REQUEST_LIST_DATA {
27147 type Message = MavMessage;
27148 const ID: u32 = 43u32;
27149 const NAME: &'static str = "MISSION_REQUEST_LIST";
27150 const EXTRA_CRC: u8 = 132u8;
27151 const ENCODED_LEN: usize = 3usize;
27152 fn deser(
27153 _version: MavlinkVersion,
27154 __input: &[u8],
27155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27156 let avail_len = __input.len();
27157 let mut payload_buf = [0; Self::ENCODED_LEN];
27158 let mut buf = if avail_len < Self::ENCODED_LEN {
27159 payload_buf[0..avail_len].copy_from_slice(__input);
27160 Bytes::new(&payload_buf)
27161 } else {
27162 Bytes::new(__input)
27163 };
27164 let mut __struct = Self::default();
27165 __struct.target_system = buf.get_u8();
27166 __struct.target_component = buf.get_u8();
27167 let tmp = buf.get_u8();
27168 __struct.mission_type =
27169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27170 enum_type: "MavMissionType",
27171 value: tmp as u32,
27172 })?;
27173 Ok(__struct)
27174 }
27175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27176 let mut __tmp = BytesMut::new(bytes);
27177 #[allow(clippy::absurd_extreme_comparisons)]
27178 #[allow(unused_comparisons)]
27179 if __tmp.remaining() < Self::ENCODED_LEN {
27180 panic!(
27181 "buffer is too small (need {} bytes, but got {})",
27182 Self::ENCODED_LEN,
27183 __tmp.remaining(),
27184 )
27185 }
27186 __tmp.put_u8(self.target_system);
27187 __tmp.put_u8(self.target_component);
27188 __tmp.put_u8(self.mission_type as u8);
27189 if matches!(version, MavlinkVersion::V2) {
27190 let len = __tmp.len();
27191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27192 } else {
27193 __tmp.len()
27194 }
27195 }
27196}
27197#[doc = "id: 37"]
27198#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
27199#[derive(Debug, Clone, PartialEq)]
27200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27202pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
27203 #[doc = "Start index"]
27204 pub start_index: i16,
27205 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
27206 pub end_index: i16,
27207 #[doc = "System ID"]
27208 pub target_system: u8,
27209 #[doc = "Component ID"]
27210 pub target_component: u8,
27211 #[doc = "Mission type."]
27212 #[cfg_attr(feature = "serde", serde(default))]
27213 pub mission_type: MavMissionType,
27214}
27215impl MISSION_REQUEST_PARTIAL_LIST_DATA {
27216 pub const ENCODED_LEN: usize = 7usize;
27217 pub const DEFAULT: Self = Self {
27218 start_index: 0_i16,
27219 end_index: 0_i16,
27220 target_system: 0_u8,
27221 target_component: 0_u8,
27222 mission_type: MavMissionType::DEFAULT,
27223 };
27224 #[cfg(feature = "arbitrary")]
27225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27226 use arbitrary::{Arbitrary, Unstructured};
27227 let mut buf = [0u8; 1024];
27228 rng.fill_bytes(&mut buf);
27229 let mut unstructured = Unstructured::new(&buf);
27230 Self::arbitrary(&mut unstructured).unwrap_or_default()
27231 }
27232}
27233impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
27234 fn default() -> Self {
27235 Self::DEFAULT.clone()
27236 }
27237}
27238impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
27239 type Message = MavMessage;
27240 const ID: u32 = 37u32;
27241 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
27242 const EXTRA_CRC: u8 = 212u8;
27243 const ENCODED_LEN: usize = 7usize;
27244 fn deser(
27245 _version: MavlinkVersion,
27246 __input: &[u8],
27247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27248 let avail_len = __input.len();
27249 let mut payload_buf = [0; Self::ENCODED_LEN];
27250 let mut buf = if avail_len < Self::ENCODED_LEN {
27251 payload_buf[0..avail_len].copy_from_slice(__input);
27252 Bytes::new(&payload_buf)
27253 } else {
27254 Bytes::new(__input)
27255 };
27256 let mut __struct = Self::default();
27257 __struct.start_index = buf.get_i16_le();
27258 __struct.end_index = buf.get_i16_le();
27259 __struct.target_system = buf.get_u8();
27260 __struct.target_component = buf.get_u8();
27261 let tmp = buf.get_u8();
27262 __struct.mission_type =
27263 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27264 enum_type: "MavMissionType",
27265 value: tmp as u32,
27266 })?;
27267 Ok(__struct)
27268 }
27269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27270 let mut __tmp = BytesMut::new(bytes);
27271 #[allow(clippy::absurd_extreme_comparisons)]
27272 #[allow(unused_comparisons)]
27273 if __tmp.remaining() < Self::ENCODED_LEN {
27274 panic!(
27275 "buffer is too small (need {} bytes, but got {})",
27276 Self::ENCODED_LEN,
27277 __tmp.remaining(),
27278 )
27279 }
27280 __tmp.put_i16_le(self.start_index);
27281 __tmp.put_i16_le(self.end_index);
27282 __tmp.put_u8(self.target_system);
27283 __tmp.put_u8(self.target_component);
27284 __tmp.put_u8(self.mission_type as u8);
27285 if matches!(version, MavlinkVersion::V2) {
27286 let len = __tmp.len();
27287 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27288 } else {
27289 __tmp.len()
27290 }
27291 }
27292}
27293#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
27294#[doc = "id: 41"]
27295#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
27296#[derive(Debug, Clone, PartialEq)]
27297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27299pub struct MISSION_SET_CURRENT_DATA {
27300 #[doc = "Sequence"]
27301 pub seq: u16,
27302 #[doc = "System ID"]
27303 pub target_system: u8,
27304 #[doc = "Component ID"]
27305 pub target_component: u8,
27306}
27307impl MISSION_SET_CURRENT_DATA {
27308 pub const ENCODED_LEN: usize = 4usize;
27309 pub const DEFAULT: Self = Self {
27310 seq: 0_u16,
27311 target_system: 0_u8,
27312 target_component: 0_u8,
27313 };
27314 #[cfg(feature = "arbitrary")]
27315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27316 use arbitrary::{Arbitrary, Unstructured};
27317 let mut buf = [0u8; 1024];
27318 rng.fill_bytes(&mut buf);
27319 let mut unstructured = Unstructured::new(&buf);
27320 Self::arbitrary(&mut unstructured).unwrap_or_default()
27321 }
27322}
27323impl Default for MISSION_SET_CURRENT_DATA {
27324 fn default() -> Self {
27325 Self::DEFAULT.clone()
27326 }
27327}
27328impl MessageData for MISSION_SET_CURRENT_DATA {
27329 type Message = MavMessage;
27330 const ID: u32 = 41u32;
27331 const NAME: &'static str = "MISSION_SET_CURRENT";
27332 const EXTRA_CRC: u8 = 28u8;
27333 const ENCODED_LEN: usize = 4usize;
27334 fn deser(
27335 _version: MavlinkVersion,
27336 __input: &[u8],
27337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27338 let avail_len = __input.len();
27339 let mut payload_buf = [0; Self::ENCODED_LEN];
27340 let mut buf = if avail_len < Self::ENCODED_LEN {
27341 payload_buf[0..avail_len].copy_from_slice(__input);
27342 Bytes::new(&payload_buf)
27343 } else {
27344 Bytes::new(__input)
27345 };
27346 let mut __struct = Self::default();
27347 __struct.seq = buf.get_u16_le();
27348 __struct.target_system = buf.get_u8();
27349 __struct.target_component = buf.get_u8();
27350 Ok(__struct)
27351 }
27352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27353 let mut __tmp = BytesMut::new(bytes);
27354 #[allow(clippy::absurd_extreme_comparisons)]
27355 #[allow(unused_comparisons)]
27356 if __tmp.remaining() < Self::ENCODED_LEN {
27357 panic!(
27358 "buffer is too small (need {} bytes, but got {})",
27359 Self::ENCODED_LEN,
27360 __tmp.remaining(),
27361 )
27362 }
27363 __tmp.put_u16_le(self.seq);
27364 __tmp.put_u8(self.target_system);
27365 __tmp.put_u8(self.target_component);
27366 if matches!(version, MavlinkVersion::V2) {
27367 let len = __tmp.len();
27368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27369 } else {
27370 __tmp.len()
27371 }
27372 }
27373}
27374#[doc = "id: 38"]
27375#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
27376#[derive(Debug, Clone, PartialEq)]
27377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27379pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
27380 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
27381 pub start_index: i16,
27382 #[doc = "End index, equal or greater than start index."]
27383 pub end_index: i16,
27384 #[doc = "System ID"]
27385 pub target_system: u8,
27386 #[doc = "Component ID"]
27387 pub target_component: u8,
27388 #[doc = "Mission type."]
27389 #[cfg_attr(feature = "serde", serde(default))]
27390 pub mission_type: MavMissionType,
27391}
27392impl MISSION_WRITE_PARTIAL_LIST_DATA {
27393 pub const ENCODED_LEN: usize = 7usize;
27394 pub const DEFAULT: Self = Self {
27395 start_index: 0_i16,
27396 end_index: 0_i16,
27397 target_system: 0_u8,
27398 target_component: 0_u8,
27399 mission_type: MavMissionType::DEFAULT,
27400 };
27401 #[cfg(feature = "arbitrary")]
27402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27403 use arbitrary::{Arbitrary, Unstructured};
27404 let mut buf = [0u8; 1024];
27405 rng.fill_bytes(&mut buf);
27406 let mut unstructured = Unstructured::new(&buf);
27407 Self::arbitrary(&mut unstructured).unwrap_or_default()
27408 }
27409}
27410impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
27411 fn default() -> Self {
27412 Self::DEFAULT.clone()
27413 }
27414}
27415impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
27416 type Message = MavMessage;
27417 const ID: u32 = 38u32;
27418 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
27419 const EXTRA_CRC: u8 = 9u8;
27420 const ENCODED_LEN: usize = 7usize;
27421 fn deser(
27422 _version: MavlinkVersion,
27423 __input: &[u8],
27424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27425 let avail_len = __input.len();
27426 let mut payload_buf = [0; Self::ENCODED_LEN];
27427 let mut buf = if avail_len < Self::ENCODED_LEN {
27428 payload_buf[0..avail_len].copy_from_slice(__input);
27429 Bytes::new(&payload_buf)
27430 } else {
27431 Bytes::new(__input)
27432 };
27433 let mut __struct = Self::default();
27434 __struct.start_index = buf.get_i16_le();
27435 __struct.end_index = buf.get_i16_le();
27436 __struct.target_system = buf.get_u8();
27437 __struct.target_component = buf.get_u8();
27438 let tmp = buf.get_u8();
27439 __struct.mission_type =
27440 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27441 enum_type: "MavMissionType",
27442 value: tmp as u32,
27443 })?;
27444 Ok(__struct)
27445 }
27446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27447 let mut __tmp = BytesMut::new(bytes);
27448 #[allow(clippy::absurd_extreme_comparisons)]
27449 #[allow(unused_comparisons)]
27450 if __tmp.remaining() < Self::ENCODED_LEN {
27451 panic!(
27452 "buffer is too small (need {} bytes, but got {})",
27453 Self::ENCODED_LEN,
27454 __tmp.remaining(),
27455 )
27456 }
27457 __tmp.put_i16_le(self.start_index);
27458 __tmp.put_i16_le(self.end_index);
27459 __tmp.put_u8(self.target_system);
27460 __tmp.put_u8(self.target_component);
27461 __tmp.put_u8(self.mission_type as u8);
27462 if matches!(version, MavlinkVersion::V2) {
27463 let len = __tmp.len();
27464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27465 } else {
27466 __tmp.len()
27467 }
27468 }
27469}
27470#[doc = "id: 156"]
27471#[doc = "Message to configure a camera mount, directional antenna, etc."]
27472#[derive(Debug, Clone, PartialEq)]
27473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27475pub struct MOUNT_CONFIGURE_DATA {
27476 #[doc = "System ID."]
27477 pub target_system: u8,
27478 #[doc = "Component ID."]
27479 pub target_component: u8,
27480 #[doc = "Mount operating mode."]
27481 pub mount_mode: MavMountMode,
27482 #[doc = "(1 = yes, 0 = no)."]
27483 pub stab_roll: u8,
27484 #[doc = "(1 = yes, 0 = no)."]
27485 pub stab_pitch: u8,
27486 #[doc = "(1 = yes, 0 = no)."]
27487 pub stab_yaw: u8,
27488}
27489impl MOUNT_CONFIGURE_DATA {
27490 pub const ENCODED_LEN: usize = 6usize;
27491 pub const DEFAULT: Self = Self {
27492 target_system: 0_u8,
27493 target_component: 0_u8,
27494 mount_mode: MavMountMode::DEFAULT,
27495 stab_roll: 0_u8,
27496 stab_pitch: 0_u8,
27497 stab_yaw: 0_u8,
27498 };
27499 #[cfg(feature = "arbitrary")]
27500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27501 use arbitrary::{Arbitrary, Unstructured};
27502 let mut buf = [0u8; 1024];
27503 rng.fill_bytes(&mut buf);
27504 let mut unstructured = Unstructured::new(&buf);
27505 Self::arbitrary(&mut unstructured).unwrap_or_default()
27506 }
27507}
27508impl Default for MOUNT_CONFIGURE_DATA {
27509 fn default() -> Self {
27510 Self::DEFAULT.clone()
27511 }
27512}
27513impl MessageData for MOUNT_CONFIGURE_DATA {
27514 type Message = MavMessage;
27515 const ID: u32 = 156u32;
27516 const NAME: &'static str = "MOUNT_CONFIGURE";
27517 const EXTRA_CRC: u8 = 19u8;
27518 const ENCODED_LEN: usize = 6usize;
27519 fn deser(
27520 _version: MavlinkVersion,
27521 __input: &[u8],
27522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27523 let avail_len = __input.len();
27524 let mut payload_buf = [0; Self::ENCODED_LEN];
27525 let mut buf = if avail_len < Self::ENCODED_LEN {
27526 payload_buf[0..avail_len].copy_from_slice(__input);
27527 Bytes::new(&payload_buf)
27528 } else {
27529 Bytes::new(__input)
27530 };
27531 let mut __struct = Self::default();
27532 __struct.target_system = buf.get_u8();
27533 __struct.target_component = buf.get_u8();
27534 let tmp = buf.get_u8();
27535 __struct.mount_mode =
27536 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27537 enum_type: "MavMountMode",
27538 value: tmp as u32,
27539 })?;
27540 __struct.stab_roll = buf.get_u8();
27541 __struct.stab_pitch = buf.get_u8();
27542 __struct.stab_yaw = buf.get_u8();
27543 Ok(__struct)
27544 }
27545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27546 let mut __tmp = BytesMut::new(bytes);
27547 #[allow(clippy::absurd_extreme_comparisons)]
27548 #[allow(unused_comparisons)]
27549 if __tmp.remaining() < Self::ENCODED_LEN {
27550 panic!(
27551 "buffer is too small (need {} bytes, but got {})",
27552 Self::ENCODED_LEN,
27553 __tmp.remaining(),
27554 )
27555 }
27556 __tmp.put_u8(self.target_system);
27557 __tmp.put_u8(self.target_component);
27558 __tmp.put_u8(self.mount_mode as u8);
27559 __tmp.put_u8(self.stab_roll);
27560 __tmp.put_u8(self.stab_pitch);
27561 __tmp.put_u8(self.stab_yaw);
27562 if matches!(version, MavlinkVersion::V2) {
27563 let len = __tmp.len();
27564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27565 } else {
27566 __tmp.len()
27567 }
27568 }
27569}
27570#[doc = "id: 157"]
27571#[doc = "Message to control a camera mount, directional antenna, etc."]
27572#[derive(Debug, Clone, PartialEq)]
27573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27575pub struct MOUNT_CONTROL_DATA {
27576 #[doc = "Pitch (centi-degrees) or lat (degE7), depending on mount mode."]
27577 pub input_a: i32,
27578 #[doc = "Roll (centi-degrees) or lon (degE7) depending on mount mode."]
27579 pub input_b: i32,
27580 #[doc = "Yaw (centi-degrees) or alt (cm) depending on mount mode."]
27581 pub input_c: i32,
27582 #[doc = "System ID."]
27583 pub target_system: u8,
27584 #[doc = "Component ID."]
27585 pub target_component: u8,
27586 #[doc = "If \"1\" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)."]
27587 pub save_position: u8,
27588}
27589impl MOUNT_CONTROL_DATA {
27590 pub const ENCODED_LEN: usize = 15usize;
27591 pub const DEFAULT: Self = Self {
27592 input_a: 0_i32,
27593 input_b: 0_i32,
27594 input_c: 0_i32,
27595 target_system: 0_u8,
27596 target_component: 0_u8,
27597 save_position: 0_u8,
27598 };
27599 #[cfg(feature = "arbitrary")]
27600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27601 use arbitrary::{Arbitrary, Unstructured};
27602 let mut buf = [0u8; 1024];
27603 rng.fill_bytes(&mut buf);
27604 let mut unstructured = Unstructured::new(&buf);
27605 Self::arbitrary(&mut unstructured).unwrap_or_default()
27606 }
27607}
27608impl Default for MOUNT_CONTROL_DATA {
27609 fn default() -> Self {
27610 Self::DEFAULT.clone()
27611 }
27612}
27613impl MessageData for MOUNT_CONTROL_DATA {
27614 type Message = MavMessage;
27615 const ID: u32 = 157u32;
27616 const NAME: &'static str = "MOUNT_CONTROL";
27617 const EXTRA_CRC: u8 = 21u8;
27618 const ENCODED_LEN: usize = 15usize;
27619 fn deser(
27620 _version: MavlinkVersion,
27621 __input: &[u8],
27622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27623 let avail_len = __input.len();
27624 let mut payload_buf = [0; Self::ENCODED_LEN];
27625 let mut buf = if avail_len < Self::ENCODED_LEN {
27626 payload_buf[0..avail_len].copy_from_slice(__input);
27627 Bytes::new(&payload_buf)
27628 } else {
27629 Bytes::new(__input)
27630 };
27631 let mut __struct = Self::default();
27632 __struct.input_a = buf.get_i32_le();
27633 __struct.input_b = buf.get_i32_le();
27634 __struct.input_c = buf.get_i32_le();
27635 __struct.target_system = buf.get_u8();
27636 __struct.target_component = buf.get_u8();
27637 __struct.save_position = buf.get_u8();
27638 Ok(__struct)
27639 }
27640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27641 let mut __tmp = BytesMut::new(bytes);
27642 #[allow(clippy::absurd_extreme_comparisons)]
27643 #[allow(unused_comparisons)]
27644 if __tmp.remaining() < Self::ENCODED_LEN {
27645 panic!(
27646 "buffer is too small (need {} bytes, but got {})",
27647 Self::ENCODED_LEN,
27648 __tmp.remaining(),
27649 )
27650 }
27651 __tmp.put_i32_le(self.input_a);
27652 __tmp.put_i32_le(self.input_b);
27653 __tmp.put_i32_le(self.input_c);
27654 __tmp.put_u8(self.target_system);
27655 __tmp.put_u8(self.target_component);
27656 __tmp.put_u8(self.save_position);
27657 if matches!(version, MavlinkVersion::V2) {
27658 let len = __tmp.len();
27659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27660 } else {
27661 __tmp.len()
27662 }
27663 }
27664}
27665#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
27666#[doc = "id: 265"]
27667#[doc = "Orientation of a mount."]
27668#[derive(Debug, Clone, PartialEq)]
27669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27671pub struct MOUNT_ORIENTATION_DATA {
27672 #[doc = "Timestamp (time since system boot)."]
27673 pub time_boot_ms: u32,
27674 #[doc = "Roll in global frame (set to NaN for invalid)."]
27675 pub roll: f32,
27676 #[doc = "Pitch in global frame (set to NaN for invalid)."]
27677 pub pitch: f32,
27678 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
27679 pub yaw: f32,
27680 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
27681 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27682 pub yaw_absolute: f32,
27683}
27684impl MOUNT_ORIENTATION_DATA {
27685 pub const ENCODED_LEN: usize = 20usize;
27686 pub const DEFAULT: Self = Self {
27687 time_boot_ms: 0_u32,
27688 roll: 0.0_f32,
27689 pitch: 0.0_f32,
27690 yaw: 0.0_f32,
27691 yaw_absolute: 0.0_f32,
27692 };
27693 #[cfg(feature = "arbitrary")]
27694 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27695 use arbitrary::{Arbitrary, Unstructured};
27696 let mut buf = [0u8; 1024];
27697 rng.fill_bytes(&mut buf);
27698 let mut unstructured = Unstructured::new(&buf);
27699 Self::arbitrary(&mut unstructured).unwrap_or_default()
27700 }
27701}
27702impl Default for MOUNT_ORIENTATION_DATA {
27703 fn default() -> Self {
27704 Self::DEFAULT.clone()
27705 }
27706}
27707impl MessageData for MOUNT_ORIENTATION_DATA {
27708 type Message = MavMessage;
27709 const ID: u32 = 265u32;
27710 const NAME: &'static str = "MOUNT_ORIENTATION";
27711 const EXTRA_CRC: u8 = 26u8;
27712 const ENCODED_LEN: usize = 20usize;
27713 fn deser(
27714 _version: MavlinkVersion,
27715 __input: &[u8],
27716 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27717 let avail_len = __input.len();
27718 let mut payload_buf = [0; Self::ENCODED_LEN];
27719 let mut buf = if avail_len < Self::ENCODED_LEN {
27720 payload_buf[0..avail_len].copy_from_slice(__input);
27721 Bytes::new(&payload_buf)
27722 } else {
27723 Bytes::new(__input)
27724 };
27725 let mut __struct = Self::default();
27726 __struct.time_boot_ms = buf.get_u32_le();
27727 __struct.roll = buf.get_f32_le();
27728 __struct.pitch = buf.get_f32_le();
27729 __struct.yaw = buf.get_f32_le();
27730 __struct.yaw_absolute = buf.get_f32_le();
27731 Ok(__struct)
27732 }
27733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27734 let mut __tmp = BytesMut::new(bytes);
27735 #[allow(clippy::absurd_extreme_comparisons)]
27736 #[allow(unused_comparisons)]
27737 if __tmp.remaining() < Self::ENCODED_LEN {
27738 panic!(
27739 "buffer is too small (need {} bytes, but got {})",
27740 Self::ENCODED_LEN,
27741 __tmp.remaining(),
27742 )
27743 }
27744 __tmp.put_u32_le(self.time_boot_ms);
27745 __tmp.put_f32_le(self.roll);
27746 __tmp.put_f32_le(self.pitch);
27747 __tmp.put_f32_le(self.yaw);
27748 __tmp.put_f32_le(self.yaw_absolute);
27749 if matches!(version, MavlinkVersion::V2) {
27750 let len = __tmp.len();
27751 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27752 } else {
27753 __tmp.len()
27754 }
27755 }
27756}
27757#[doc = "id: 158"]
27758#[doc = "Message with some status from autopilot to GCS about camera or antenna mount."]
27759#[derive(Debug, Clone, PartialEq)]
27760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27762pub struct MOUNT_STATUS_DATA {
27763 #[doc = "Pitch."]
27764 pub pointing_a: i32,
27765 #[doc = "Roll."]
27766 pub pointing_b: i32,
27767 #[doc = "Yaw."]
27768 pub pointing_c: i32,
27769 #[doc = "System ID."]
27770 pub target_system: u8,
27771 #[doc = "Component ID."]
27772 pub target_component: u8,
27773 #[doc = "Mount operating mode."]
27774 #[cfg_attr(feature = "serde", serde(default))]
27775 pub mount_mode: MavMountMode,
27776}
27777impl MOUNT_STATUS_DATA {
27778 pub const ENCODED_LEN: usize = 15usize;
27779 pub const DEFAULT: Self = Self {
27780 pointing_a: 0_i32,
27781 pointing_b: 0_i32,
27782 pointing_c: 0_i32,
27783 target_system: 0_u8,
27784 target_component: 0_u8,
27785 mount_mode: MavMountMode::DEFAULT,
27786 };
27787 #[cfg(feature = "arbitrary")]
27788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27789 use arbitrary::{Arbitrary, Unstructured};
27790 let mut buf = [0u8; 1024];
27791 rng.fill_bytes(&mut buf);
27792 let mut unstructured = Unstructured::new(&buf);
27793 Self::arbitrary(&mut unstructured).unwrap_or_default()
27794 }
27795}
27796impl Default for MOUNT_STATUS_DATA {
27797 fn default() -> Self {
27798 Self::DEFAULT.clone()
27799 }
27800}
27801impl MessageData for MOUNT_STATUS_DATA {
27802 type Message = MavMessage;
27803 const ID: u32 = 158u32;
27804 const NAME: &'static str = "MOUNT_STATUS";
27805 const EXTRA_CRC: u8 = 134u8;
27806 const ENCODED_LEN: usize = 15usize;
27807 fn deser(
27808 _version: MavlinkVersion,
27809 __input: &[u8],
27810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27811 let avail_len = __input.len();
27812 let mut payload_buf = [0; Self::ENCODED_LEN];
27813 let mut buf = if avail_len < Self::ENCODED_LEN {
27814 payload_buf[0..avail_len].copy_from_slice(__input);
27815 Bytes::new(&payload_buf)
27816 } else {
27817 Bytes::new(__input)
27818 };
27819 let mut __struct = Self::default();
27820 __struct.pointing_a = buf.get_i32_le();
27821 __struct.pointing_b = buf.get_i32_le();
27822 __struct.pointing_c = buf.get_i32_le();
27823 __struct.target_system = buf.get_u8();
27824 __struct.target_component = buf.get_u8();
27825 let tmp = buf.get_u8();
27826 __struct.mount_mode =
27827 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27828 enum_type: "MavMountMode",
27829 value: tmp as u32,
27830 })?;
27831 Ok(__struct)
27832 }
27833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27834 let mut __tmp = BytesMut::new(bytes);
27835 #[allow(clippy::absurd_extreme_comparisons)]
27836 #[allow(unused_comparisons)]
27837 if __tmp.remaining() < Self::ENCODED_LEN {
27838 panic!(
27839 "buffer is too small (need {} bytes, but got {})",
27840 Self::ENCODED_LEN,
27841 __tmp.remaining(),
27842 )
27843 }
27844 __tmp.put_i32_le(self.pointing_a);
27845 __tmp.put_i32_le(self.pointing_b);
27846 __tmp.put_i32_le(self.pointing_c);
27847 __tmp.put_u8(self.target_system);
27848 __tmp.put_u8(self.target_component);
27849 __tmp.put_u8(self.mount_mode as u8);
27850 if matches!(version, MavlinkVersion::V2) {
27851 let len = __tmp.len();
27852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27853 } else {
27854 __tmp.len()
27855 }
27856 }
27857}
27858#[doc = "id: 251"]
27859#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
27860#[derive(Debug, Clone, PartialEq)]
27861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27863pub struct NAMED_VALUE_FLOAT_DATA {
27864 #[doc = "Timestamp (time since system boot)."]
27865 pub time_boot_ms: u32,
27866 #[doc = "Floating point value"]
27867 pub value: f32,
27868 #[doc = "Name of the debug variable"]
27869 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27870 pub name: [u8; 10],
27871}
27872impl NAMED_VALUE_FLOAT_DATA {
27873 pub const ENCODED_LEN: usize = 18usize;
27874 pub const DEFAULT: Self = Self {
27875 time_boot_ms: 0_u32,
27876 value: 0.0_f32,
27877 name: [0_u8; 10usize],
27878 };
27879 #[cfg(feature = "arbitrary")]
27880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27881 use arbitrary::{Arbitrary, Unstructured};
27882 let mut buf = [0u8; 1024];
27883 rng.fill_bytes(&mut buf);
27884 let mut unstructured = Unstructured::new(&buf);
27885 Self::arbitrary(&mut unstructured).unwrap_or_default()
27886 }
27887}
27888impl Default for NAMED_VALUE_FLOAT_DATA {
27889 fn default() -> Self {
27890 Self::DEFAULT.clone()
27891 }
27892}
27893impl MessageData for NAMED_VALUE_FLOAT_DATA {
27894 type Message = MavMessage;
27895 const ID: u32 = 251u32;
27896 const NAME: &'static str = "NAMED_VALUE_FLOAT";
27897 const EXTRA_CRC: u8 = 170u8;
27898 const ENCODED_LEN: usize = 18usize;
27899 fn deser(
27900 _version: MavlinkVersion,
27901 __input: &[u8],
27902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27903 let avail_len = __input.len();
27904 let mut payload_buf = [0; Self::ENCODED_LEN];
27905 let mut buf = if avail_len < Self::ENCODED_LEN {
27906 payload_buf[0..avail_len].copy_from_slice(__input);
27907 Bytes::new(&payload_buf)
27908 } else {
27909 Bytes::new(__input)
27910 };
27911 let mut __struct = Self::default();
27912 __struct.time_boot_ms = buf.get_u32_le();
27913 __struct.value = buf.get_f32_le();
27914 for v in &mut __struct.name {
27915 let val = buf.get_u8();
27916 *v = val;
27917 }
27918 Ok(__struct)
27919 }
27920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27921 let mut __tmp = BytesMut::new(bytes);
27922 #[allow(clippy::absurd_extreme_comparisons)]
27923 #[allow(unused_comparisons)]
27924 if __tmp.remaining() < Self::ENCODED_LEN {
27925 panic!(
27926 "buffer is too small (need {} bytes, but got {})",
27927 Self::ENCODED_LEN,
27928 __tmp.remaining(),
27929 )
27930 }
27931 __tmp.put_u32_le(self.time_boot_ms);
27932 __tmp.put_f32_le(self.value);
27933 for val in &self.name {
27934 __tmp.put_u8(*val);
27935 }
27936 if matches!(version, MavlinkVersion::V2) {
27937 let len = __tmp.len();
27938 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27939 } else {
27940 __tmp.len()
27941 }
27942 }
27943}
27944#[doc = "id: 252"]
27945#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
27946#[derive(Debug, Clone, PartialEq)]
27947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27949pub struct NAMED_VALUE_INT_DATA {
27950 #[doc = "Timestamp (time since system boot)."]
27951 pub time_boot_ms: u32,
27952 #[doc = "Signed integer value"]
27953 pub value: i32,
27954 #[doc = "Name of the debug variable"]
27955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27956 pub name: [u8; 10],
27957}
27958impl NAMED_VALUE_INT_DATA {
27959 pub const ENCODED_LEN: usize = 18usize;
27960 pub const DEFAULT: Self = Self {
27961 time_boot_ms: 0_u32,
27962 value: 0_i32,
27963 name: [0_u8; 10usize],
27964 };
27965 #[cfg(feature = "arbitrary")]
27966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27967 use arbitrary::{Arbitrary, Unstructured};
27968 let mut buf = [0u8; 1024];
27969 rng.fill_bytes(&mut buf);
27970 let mut unstructured = Unstructured::new(&buf);
27971 Self::arbitrary(&mut unstructured).unwrap_or_default()
27972 }
27973}
27974impl Default for NAMED_VALUE_INT_DATA {
27975 fn default() -> Self {
27976 Self::DEFAULT.clone()
27977 }
27978}
27979impl MessageData for NAMED_VALUE_INT_DATA {
27980 type Message = MavMessage;
27981 const ID: u32 = 252u32;
27982 const NAME: &'static str = "NAMED_VALUE_INT";
27983 const EXTRA_CRC: u8 = 44u8;
27984 const ENCODED_LEN: usize = 18usize;
27985 fn deser(
27986 _version: MavlinkVersion,
27987 __input: &[u8],
27988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27989 let avail_len = __input.len();
27990 let mut payload_buf = [0; Self::ENCODED_LEN];
27991 let mut buf = if avail_len < Self::ENCODED_LEN {
27992 payload_buf[0..avail_len].copy_from_slice(__input);
27993 Bytes::new(&payload_buf)
27994 } else {
27995 Bytes::new(__input)
27996 };
27997 let mut __struct = Self::default();
27998 __struct.time_boot_ms = buf.get_u32_le();
27999 __struct.value = buf.get_i32_le();
28000 for v in &mut __struct.name {
28001 let val = buf.get_u8();
28002 *v = val;
28003 }
28004 Ok(__struct)
28005 }
28006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28007 let mut __tmp = BytesMut::new(bytes);
28008 #[allow(clippy::absurd_extreme_comparisons)]
28009 #[allow(unused_comparisons)]
28010 if __tmp.remaining() < Self::ENCODED_LEN {
28011 panic!(
28012 "buffer is too small (need {} bytes, but got {})",
28013 Self::ENCODED_LEN,
28014 __tmp.remaining(),
28015 )
28016 }
28017 __tmp.put_u32_le(self.time_boot_ms);
28018 __tmp.put_i32_le(self.value);
28019 for val in &self.name {
28020 __tmp.put_u8(*val);
28021 }
28022 if matches!(version, MavlinkVersion::V2) {
28023 let len = __tmp.len();
28024 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28025 } else {
28026 __tmp.len()
28027 }
28028 }
28029}
28030#[doc = "id: 62"]
28031#[doc = "The state of the navigation and position controller."]
28032#[derive(Debug, Clone, PartialEq)]
28033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28035pub struct NAV_CONTROLLER_OUTPUT_DATA {
28036 #[doc = "Current desired roll"]
28037 pub nav_roll: f32,
28038 #[doc = "Current desired pitch"]
28039 pub nav_pitch: f32,
28040 #[doc = "Current altitude error"]
28041 pub alt_error: f32,
28042 #[doc = "Current airspeed error"]
28043 pub aspd_error: f32,
28044 #[doc = "Current crosstrack error on x-y plane"]
28045 pub xtrack_error: f32,
28046 #[doc = "Current desired heading"]
28047 pub nav_bearing: i16,
28048 #[doc = "Bearing to current waypoint/target"]
28049 pub target_bearing: i16,
28050 #[doc = "Distance to active waypoint"]
28051 pub wp_dist: u16,
28052}
28053impl NAV_CONTROLLER_OUTPUT_DATA {
28054 pub const ENCODED_LEN: usize = 26usize;
28055 pub const DEFAULT: Self = Self {
28056 nav_roll: 0.0_f32,
28057 nav_pitch: 0.0_f32,
28058 alt_error: 0.0_f32,
28059 aspd_error: 0.0_f32,
28060 xtrack_error: 0.0_f32,
28061 nav_bearing: 0_i16,
28062 target_bearing: 0_i16,
28063 wp_dist: 0_u16,
28064 };
28065 #[cfg(feature = "arbitrary")]
28066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28067 use arbitrary::{Arbitrary, Unstructured};
28068 let mut buf = [0u8; 1024];
28069 rng.fill_bytes(&mut buf);
28070 let mut unstructured = Unstructured::new(&buf);
28071 Self::arbitrary(&mut unstructured).unwrap_or_default()
28072 }
28073}
28074impl Default for NAV_CONTROLLER_OUTPUT_DATA {
28075 fn default() -> Self {
28076 Self::DEFAULT.clone()
28077 }
28078}
28079impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
28080 type Message = MavMessage;
28081 const ID: u32 = 62u32;
28082 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
28083 const EXTRA_CRC: u8 = 183u8;
28084 const ENCODED_LEN: usize = 26usize;
28085 fn deser(
28086 _version: MavlinkVersion,
28087 __input: &[u8],
28088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28089 let avail_len = __input.len();
28090 let mut payload_buf = [0; Self::ENCODED_LEN];
28091 let mut buf = if avail_len < Self::ENCODED_LEN {
28092 payload_buf[0..avail_len].copy_from_slice(__input);
28093 Bytes::new(&payload_buf)
28094 } else {
28095 Bytes::new(__input)
28096 };
28097 let mut __struct = Self::default();
28098 __struct.nav_roll = buf.get_f32_le();
28099 __struct.nav_pitch = buf.get_f32_le();
28100 __struct.alt_error = buf.get_f32_le();
28101 __struct.aspd_error = buf.get_f32_le();
28102 __struct.xtrack_error = buf.get_f32_le();
28103 __struct.nav_bearing = buf.get_i16_le();
28104 __struct.target_bearing = buf.get_i16_le();
28105 __struct.wp_dist = buf.get_u16_le();
28106 Ok(__struct)
28107 }
28108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28109 let mut __tmp = BytesMut::new(bytes);
28110 #[allow(clippy::absurd_extreme_comparisons)]
28111 #[allow(unused_comparisons)]
28112 if __tmp.remaining() < Self::ENCODED_LEN {
28113 panic!(
28114 "buffer is too small (need {} bytes, but got {})",
28115 Self::ENCODED_LEN,
28116 __tmp.remaining(),
28117 )
28118 }
28119 __tmp.put_f32_le(self.nav_roll);
28120 __tmp.put_f32_le(self.nav_pitch);
28121 __tmp.put_f32_le(self.alt_error);
28122 __tmp.put_f32_le(self.aspd_error);
28123 __tmp.put_f32_le(self.xtrack_error);
28124 __tmp.put_i16_le(self.nav_bearing);
28125 __tmp.put_i16_le(self.target_bearing);
28126 __tmp.put_u16_le(self.wp_dist);
28127 if matches!(version, MavlinkVersion::V2) {
28128 let len = __tmp.len();
28129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28130 } else {
28131 __tmp.len()
28132 }
28133 }
28134}
28135#[doc = "id: 330"]
28136#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
28137#[derive(Debug, Clone, PartialEq)]
28138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28140pub struct OBSTACLE_DISTANCE_DATA {
28141 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28142 pub time_usec: u64,
28143 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
28144 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28145 pub distances: [u16; 72],
28146 #[doc = "Minimum distance the sensor can measure."]
28147 pub min_distance: u16,
28148 #[doc = "Maximum distance the sensor can measure."]
28149 pub max_distance: u16,
28150 #[doc = "Class id of the distance sensor type."]
28151 pub sensor_type: MavDistanceSensor,
28152 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
28153 pub increment: u8,
28154 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
28155 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28156 pub increment_f: f32,
28157 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
28158 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28159 pub angle_offset: f32,
28160 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
28161 #[cfg_attr(feature = "serde", serde(default))]
28162 pub frame: MavFrame,
28163}
28164impl OBSTACLE_DISTANCE_DATA {
28165 pub const ENCODED_LEN: usize = 167usize;
28166 pub const DEFAULT: Self = Self {
28167 time_usec: 0_u64,
28168 distances: [0_u16; 72usize],
28169 min_distance: 0_u16,
28170 max_distance: 0_u16,
28171 sensor_type: MavDistanceSensor::DEFAULT,
28172 increment: 0_u8,
28173 increment_f: 0.0_f32,
28174 angle_offset: 0.0_f32,
28175 frame: MavFrame::DEFAULT,
28176 };
28177 #[cfg(feature = "arbitrary")]
28178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28179 use arbitrary::{Arbitrary, Unstructured};
28180 let mut buf = [0u8; 1024];
28181 rng.fill_bytes(&mut buf);
28182 let mut unstructured = Unstructured::new(&buf);
28183 Self::arbitrary(&mut unstructured).unwrap_or_default()
28184 }
28185}
28186impl Default for OBSTACLE_DISTANCE_DATA {
28187 fn default() -> Self {
28188 Self::DEFAULT.clone()
28189 }
28190}
28191impl MessageData for OBSTACLE_DISTANCE_DATA {
28192 type Message = MavMessage;
28193 const ID: u32 = 330u32;
28194 const NAME: &'static str = "OBSTACLE_DISTANCE";
28195 const EXTRA_CRC: u8 = 23u8;
28196 const ENCODED_LEN: usize = 167usize;
28197 fn deser(
28198 _version: MavlinkVersion,
28199 __input: &[u8],
28200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28201 let avail_len = __input.len();
28202 let mut payload_buf = [0; Self::ENCODED_LEN];
28203 let mut buf = if avail_len < Self::ENCODED_LEN {
28204 payload_buf[0..avail_len].copy_from_slice(__input);
28205 Bytes::new(&payload_buf)
28206 } else {
28207 Bytes::new(__input)
28208 };
28209 let mut __struct = Self::default();
28210 __struct.time_usec = buf.get_u64_le();
28211 for v in &mut __struct.distances {
28212 let val = buf.get_u16_le();
28213 *v = val;
28214 }
28215 __struct.min_distance = buf.get_u16_le();
28216 __struct.max_distance = buf.get_u16_le();
28217 let tmp = buf.get_u8();
28218 __struct.sensor_type =
28219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28220 enum_type: "MavDistanceSensor",
28221 value: tmp as u32,
28222 })?;
28223 __struct.increment = buf.get_u8();
28224 __struct.increment_f = buf.get_f32_le();
28225 __struct.angle_offset = buf.get_f32_le();
28226 let tmp = buf.get_u8();
28227 __struct.frame =
28228 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28229 enum_type: "MavFrame",
28230 value: tmp as u32,
28231 })?;
28232 Ok(__struct)
28233 }
28234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28235 let mut __tmp = BytesMut::new(bytes);
28236 #[allow(clippy::absurd_extreme_comparisons)]
28237 #[allow(unused_comparisons)]
28238 if __tmp.remaining() < Self::ENCODED_LEN {
28239 panic!(
28240 "buffer is too small (need {} bytes, but got {})",
28241 Self::ENCODED_LEN,
28242 __tmp.remaining(),
28243 )
28244 }
28245 __tmp.put_u64_le(self.time_usec);
28246 for val in &self.distances {
28247 __tmp.put_u16_le(*val);
28248 }
28249 __tmp.put_u16_le(self.min_distance);
28250 __tmp.put_u16_le(self.max_distance);
28251 __tmp.put_u8(self.sensor_type as u8);
28252 __tmp.put_u8(self.increment);
28253 __tmp.put_f32_le(self.increment_f);
28254 __tmp.put_f32_le(self.angle_offset);
28255 __tmp.put_u8(self.frame as u8);
28256 if matches!(version, MavlinkVersion::V2) {
28257 let len = __tmp.len();
28258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28259 } else {
28260 __tmp.len()
28261 }
28262 }
28263}
28264#[doc = "id: 11037"]
28265#[doc = "Obstacle located as a 3D vector."]
28266#[derive(Debug, Clone, PartialEq)]
28267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28269pub struct OBSTACLE_DISTANCE_3D_DATA {
28270 #[doc = "Timestamp (time since system boot)."]
28271 pub time_boot_ms: u32,
28272 #[doc = "X position of the obstacle."]
28273 pub x: f32,
28274 #[doc = "Y position of the obstacle."]
28275 pub y: f32,
28276 #[doc = "Z position of the obstacle."]
28277 pub z: f32,
28278 #[doc = "Minimum distance the sensor can measure."]
28279 pub min_distance: f32,
28280 #[doc = "Maximum distance the sensor can measure."]
28281 pub max_distance: f32,
28282 #[doc = "Unique ID given to each obstacle so that its movement can be tracked. Use UINT16_MAX if object ID is unknown or cannot be determined."]
28283 pub obstacle_id: u16,
28284 #[doc = "Class id of the distance sensor type."]
28285 pub sensor_type: MavDistanceSensor,
28286 #[doc = "Coordinate frame of reference."]
28287 pub frame: MavFrame,
28288}
28289impl OBSTACLE_DISTANCE_3D_DATA {
28290 pub const ENCODED_LEN: usize = 28usize;
28291 pub const DEFAULT: Self = Self {
28292 time_boot_ms: 0_u32,
28293 x: 0.0_f32,
28294 y: 0.0_f32,
28295 z: 0.0_f32,
28296 min_distance: 0.0_f32,
28297 max_distance: 0.0_f32,
28298 obstacle_id: 0_u16,
28299 sensor_type: MavDistanceSensor::DEFAULT,
28300 frame: MavFrame::DEFAULT,
28301 };
28302 #[cfg(feature = "arbitrary")]
28303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28304 use arbitrary::{Arbitrary, Unstructured};
28305 let mut buf = [0u8; 1024];
28306 rng.fill_bytes(&mut buf);
28307 let mut unstructured = Unstructured::new(&buf);
28308 Self::arbitrary(&mut unstructured).unwrap_or_default()
28309 }
28310}
28311impl Default for OBSTACLE_DISTANCE_3D_DATA {
28312 fn default() -> Self {
28313 Self::DEFAULT.clone()
28314 }
28315}
28316impl MessageData for OBSTACLE_DISTANCE_3D_DATA {
28317 type Message = MavMessage;
28318 const ID: u32 = 11037u32;
28319 const NAME: &'static str = "OBSTACLE_DISTANCE_3D";
28320 const EXTRA_CRC: u8 = 130u8;
28321 const ENCODED_LEN: usize = 28usize;
28322 fn deser(
28323 _version: MavlinkVersion,
28324 __input: &[u8],
28325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28326 let avail_len = __input.len();
28327 let mut payload_buf = [0; Self::ENCODED_LEN];
28328 let mut buf = if avail_len < Self::ENCODED_LEN {
28329 payload_buf[0..avail_len].copy_from_slice(__input);
28330 Bytes::new(&payload_buf)
28331 } else {
28332 Bytes::new(__input)
28333 };
28334 let mut __struct = Self::default();
28335 __struct.time_boot_ms = buf.get_u32_le();
28336 __struct.x = buf.get_f32_le();
28337 __struct.y = buf.get_f32_le();
28338 __struct.z = buf.get_f32_le();
28339 __struct.min_distance = buf.get_f32_le();
28340 __struct.max_distance = buf.get_f32_le();
28341 __struct.obstacle_id = buf.get_u16_le();
28342 let tmp = buf.get_u8();
28343 __struct.sensor_type =
28344 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28345 enum_type: "MavDistanceSensor",
28346 value: tmp as u32,
28347 })?;
28348 let tmp = buf.get_u8();
28349 __struct.frame =
28350 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28351 enum_type: "MavFrame",
28352 value: tmp as u32,
28353 })?;
28354 Ok(__struct)
28355 }
28356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28357 let mut __tmp = BytesMut::new(bytes);
28358 #[allow(clippy::absurd_extreme_comparisons)]
28359 #[allow(unused_comparisons)]
28360 if __tmp.remaining() < Self::ENCODED_LEN {
28361 panic!(
28362 "buffer is too small (need {} bytes, but got {})",
28363 Self::ENCODED_LEN,
28364 __tmp.remaining(),
28365 )
28366 }
28367 __tmp.put_u32_le(self.time_boot_ms);
28368 __tmp.put_f32_le(self.x);
28369 __tmp.put_f32_le(self.y);
28370 __tmp.put_f32_le(self.z);
28371 __tmp.put_f32_le(self.min_distance);
28372 __tmp.put_f32_le(self.max_distance);
28373 __tmp.put_u16_le(self.obstacle_id);
28374 __tmp.put_u8(self.sensor_type as u8);
28375 __tmp.put_u8(self.frame as u8);
28376 if matches!(version, MavlinkVersion::V2) {
28377 let len = __tmp.len();
28378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28379 } else {
28380 __tmp.len()
28381 }
28382 }
28383}
28384#[doc = "id: 331"]
28385#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
28386#[derive(Debug, Clone, PartialEq)]
28387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28389pub struct ODOMETRY_DATA {
28390 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28391 pub time_usec: u64,
28392 #[doc = "X Position"]
28393 pub x: f32,
28394 #[doc = "Y Position"]
28395 pub y: f32,
28396 #[doc = "Z Position"]
28397 pub z: f32,
28398 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
28399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28400 pub q: [f32; 4],
28401 #[doc = "X linear speed"]
28402 pub vx: f32,
28403 #[doc = "Y linear speed"]
28404 pub vy: f32,
28405 #[doc = "Z linear speed"]
28406 pub vz: f32,
28407 #[doc = "Roll angular speed"]
28408 pub rollspeed: f32,
28409 #[doc = "Pitch angular speed"]
28410 pub pitchspeed: f32,
28411 #[doc = "Yaw angular speed"]
28412 pub yawspeed: f32,
28413 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
28414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28415 pub pose_covariance: [f32; 21],
28416 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
28417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28418 pub velocity_covariance: [f32; 21],
28419 #[doc = "Coordinate frame of reference for the pose data."]
28420 pub frame_id: MavFrame,
28421 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
28422 pub child_frame_id: MavFrame,
28423 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
28424 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28425 pub reset_counter: u8,
28426 #[doc = "Type of estimator that is providing the odometry."]
28427 #[cfg_attr(feature = "serde", serde(default))]
28428 pub estimator_type: MavEstimatorType,
28429 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
28430 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28431 pub quality: i8,
28432}
28433impl ODOMETRY_DATA {
28434 pub const ENCODED_LEN: usize = 233usize;
28435 pub const DEFAULT: Self = Self {
28436 time_usec: 0_u64,
28437 x: 0.0_f32,
28438 y: 0.0_f32,
28439 z: 0.0_f32,
28440 q: [0.0_f32; 4usize],
28441 vx: 0.0_f32,
28442 vy: 0.0_f32,
28443 vz: 0.0_f32,
28444 rollspeed: 0.0_f32,
28445 pitchspeed: 0.0_f32,
28446 yawspeed: 0.0_f32,
28447 pose_covariance: [0.0_f32; 21usize],
28448 velocity_covariance: [0.0_f32; 21usize],
28449 frame_id: MavFrame::DEFAULT,
28450 child_frame_id: MavFrame::DEFAULT,
28451 reset_counter: 0_u8,
28452 estimator_type: MavEstimatorType::DEFAULT,
28453 quality: 0_i8,
28454 };
28455 #[cfg(feature = "arbitrary")]
28456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28457 use arbitrary::{Arbitrary, Unstructured};
28458 let mut buf = [0u8; 1024];
28459 rng.fill_bytes(&mut buf);
28460 let mut unstructured = Unstructured::new(&buf);
28461 Self::arbitrary(&mut unstructured).unwrap_or_default()
28462 }
28463}
28464impl Default for ODOMETRY_DATA {
28465 fn default() -> Self {
28466 Self::DEFAULT.clone()
28467 }
28468}
28469impl MessageData for ODOMETRY_DATA {
28470 type Message = MavMessage;
28471 const ID: u32 = 331u32;
28472 const NAME: &'static str = "ODOMETRY";
28473 const EXTRA_CRC: u8 = 91u8;
28474 const ENCODED_LEN: usize = 233usize;
28475 fn deser(
28476 _version: MavlinkVersion,
28477 __input: &[u8],
28478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28479 let avail_len = __input.len();
28480 let mut payload_buf = [0; Self::ENCODED_LEN];
28481 let mut buf = if avail_len < Self::ENCODED_LEN {
28482 payload_buf[0..avail_len].copy_from_slice(__input);
28483 Bytes::new(&payload_buf)
28484 } else {
28485 Bytes::new(__input)
28486 };
28487 let mut __struct = Self::default();
28488 __struct.time_usec = buf.get_u64_le();
28489 __struct.x = buf.get_f32_le();
28490 __struct.y = buf.get_f32_le();
28491 __struct.z = buf.get_f32_le();
28492 for v in &mut __struct.q {
28493 let val = buf.get_f32_le();
28494 *v = val;
28495 }
28496 __struct.vx = buf.get_f32_le();
28497 __struct.vy = buf.get_f32_le();
28498 __struct.vz = buf.get_f32_le();
28499 __struct.rollspeed = buf.get_f32_le();
28500 __struct.pitchspeed = buf.get_f32_le();
28501 __struct.yawspeed = buf.get_f32_le();
28502 for v in &mut __struct.pose_covariance {
28503 let val = buf.get_f32_le();
28504 *v = val;
28505 }
28506 for v in &mut __struct.velocity_covariance {
28507 let val = buf.get_f32_le();
28508 *v = val;
28509 }
28510 let tmp = buf.get_u8();
28511 __struct.frame_id =
28512 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28513 enum_type: "MavFrame",
28514 value: tmp as u32,
28515 })?;
28516 let tmp = buf.get_u8();
28517 __struct.child_frame_id =
28518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28519 enum_type: "MavFrame",
28520 value: tmp as u32,
28521 })?;
28522 __struct.reset_counter = buf.get_u8();
28523 let tmp = buf.get_u8();
28524 __struct.estimator_type =
28525 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28526 enum_type: "MavEstimatorType",
28527 value: tmp as u32,
28528 })?;
28529 __struct.quality = buf.get_i8();
28530 Ok(__struct)
28531 }
28532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28533 let mut __tmp = BytesMut::new(bytes);
28534 #[allow(clippy::absurd_extreme_comparisons)]
28535 #[allow(unused_comparisons)]
28536 if __tmp.remaining() < Self::ENCODED_LEN {
28537 panic!(
28538 "buffer is too small (need {} bytes, but got {})",
28539 Self::ENCODED_LEN,
28540 __tmp.remaining(),
28541 )
28542 }
28543 __tmp.put_u64_le(self.time_usec);
28544 __tmp.put_f32_le(self.x);
28545 __tmp.put_f32_le(self.y);
28546 __tmp.put_f32_le(self.z);
28547 for val in &self.q {
28548 __tmp.put_f32_le(*val);
28549 }
28550 __tmp.put_f32_le(self.vx);
28551 __tmp.put_f32_le(self.vy);
28552 __tmp.put_f32_le(self.vz);
28553 __tmp.put_f32_le(self.rollspeed);
28554 __tmp.put_f32_le(self.pitchspeed);
28555 __tmp.put_f32_le(self.yawspeed);
28556 for val in &self.pose_covariance {
28557 __tmp.put_f32_le(*val);
28558 }
28559 for val in &self.velocity_covariance {
28560 __tmp.put_f32_le(*val);
28561 }
28562 __tmp.put_u8(self.frame_id as u8);
28563 __tmp.put_u8(self.child_frame_id as u8);
28564 __tmp.put_u8(self.reset_counter);
28565 __tmp.put_u8(self.estimator_type as u8);
28566 __tmp.put_i8(self.quality);
28567 if matches!(version, MavlinkVersion::V2) {
28568 let len = __tmp.len();
28569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28570 } else {
28571 __tmp.len()
28572 }
28573 }
28574}
28575#[doc = "id: 390"]
28576#[doc = "Hardware status sent by an onboard computer."]
28577#[derive(Debug, Clone, PartialEq)]
28578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28580pub struct ONBOARD_COMPUTER_STATUS_DATA {
28581 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28582 pub time_usec: u64,
28583 #[doc = "Time since system boot."]
28584 pub uptime: u32,
28585 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
28586 pub ram_usage: u32,
28587 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
28588 pub ram_total: u32,
28589 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
28590 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28591 pub storage_type: [u32; 4],
28592 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
28593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28594 pub storage_usage: [u32; 4],
28595 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
28596 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28597 pub storage_total: [u32; 4],
28598 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
28599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28600 pub link_type: [u32; 6],
28601 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
28602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28603 pub link_tx_rate: [u32; 6],
28604 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
28605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28606 pub link_rx_rate: [u32; 6],
28607 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
28608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28609 pub link_tx_max: [u32; 6],
28610 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
28611 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28612 pub link_rx_max: [u32; 6],
28613 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
28614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28615 pub fan_speed: [i16; 4],
28616 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
28617 pub mavtype: u8,
28618 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
28619 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28620 pub cpu_cores: [u8; 8],
28621 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
28622 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28623 pub cpu_combined: [u8; 10],
28624 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
28625 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28626 pub gpu_cores: [u8; 4],
28627 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
28628 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28629 pub gpu_combined: [u8; 10],
28630 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
28631 pub temperature_board: i8,
28632 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
28633 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28634 pub temperature_core: [i8; 8],
28635}
28636impl ONBOARD_COMPUTER_STATUS_DATA {
28637 pub const ENCODED_LEN: usize = 238usize;
28638 pub const DEFAULT: Self = Self {
28639 time_usec: 0_u64,
28640 uptime: 0_u32,
28641 ram_usage: 0_u32,
28642 ram_total: 0_u32,
28643 storage_type: [0_u32; 4usize],
28644 storage_usage: [0_u32; 4usize],
28645 storage_total: [0_u32; 4usize],
28646 link_type: [0_u32; 6usize],
28647 link_tx_rate: [0_u32; 6usize],
28648 link_rx_rate: [0_u32; 6usize],
28649 link_tx_max: [0_u32; 6usize],
28650 link_rx_max: [0_u32; 6usize],
28651 fan_speed: [0_i16; 4usize],
28652 mavtype: 0_u8,
28653 cpu_cores: [0_u8; 8usize],
28654 cpu_combined: [0_u8; 10usize],
28655 gpu_cores: [0_u8; 4usize],
28656 gpu_combined: [0_u8; 10usize],
28657 temperature_board: 0_i8,
28658 temperature_core: [0_i8; 8usize],
28659 };
28660 #[cfg(feature = "arbitrary")]
28661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28662 use arbitrary::{Arbitrary, Unstructured};
28663 let mut buf = [0u8; 1024];
28664 rng.fill_bytes(&mut buf);
28665 let mut unstructured = Unstructured::new(&buf);
28666 Self::arbitrary(&mut unstructured).unwrap_or_default()
28667 }
28668}
28669impl Default for ONBOARD_COMPUTER_STATUS_DATA {
28670 fn default() -> Self {
28671 Self::DEFAULT.clone()
28672 }
28673}
28674impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
28675 type Message = MavMessage;
28676 const ID: u32 = 390u32;
28677 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
28678 const EXTRA_CRC: u8 = 156u8;
28679 const ENCODED_LEN: usize = 238usize;
28680 fn deser(
28681 _version: MavlinkVersion,
28682 __input: &[u8],
28683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28684 let avail_len = __input.len();
28685 let mut payload_buf = [0; Self::ENCODED_LEN];
28686 let mut buf = if avail_len < Self::ENCODED_LEN {
28687 payload_buf[0..avail_len].copy_from_slice(__input);
28688 Bytes::new(&payload_buf)
28689 } else {
28690 Bytes::new(__input)
28691 };
28692 let mut __struct = Self::default();
28693 __struct.time_usec = buf.get_u64_le();
28694 __struct.uptime = buf.get_u32_le();
28695 __struct.ram_usage = buf.get_u32_le();
28696 __struct.ram_total = buf.get_u32_le();
28697 for v in &mut __struct.storage_type {
28698 let val = buf.get_u32_le();
28699 *v = val;
28700 }
28701 for v in &mut __struct.storage_usage {
28702 let val = buf.get_u32_le();
28703 *v = val;
28704 }
28705 for v in &mut __struct.storage_total {
28706 let val = buf.get_u32_le();
28707 *v = val;
28708 }
28709 for v in &mut __struct.link_type {
28710 let val = buf.get_u32_le();
28711 *v = val;
28712 }
28713 for v in &mut __struct.link_tx_rate {
28714 let val = buf.get_u32_le();
28715 *v = val;
28716 }
28717 for v in &mut __struct.link_rx_rate {
28718 let val = buf.get_u32_le();
28719 *v = val;
28720 }
28721 for v in &mut __struct.link_tx_max {
28722 let val = buf.get_u32_le();
28723 *v = val;
28724 }
28725 for v in &mut __struct.link_rx_max {
28726 let val = buf.get_u32_le();
28727 *v = val;
28728 }
28729 for v in &mut __struct.fan_speed {
28730 let val = buf.get_i16_le();
28731 *v = val;
28732 }
28733 __struct.mavtype = buf.get_u8();
28734 for v in &mut __struct.cpu_cores {
28735 let val = buf.get_u8();
28736 *v = val;
28737 }
28738 for v in &mut __struct.cpu_combined {
28739 let val = buf.get_u8();
28740 *v = val;
28741 }
28742 for v in &mut __struct.gpu_cores {
28743 let val = buf.get_u8();
28744 *v = val;
28745 }
28746 for v in &mut __struct.gpu_combined {
28747 let val = buf.get_u8();
28748 *v = val;
28749 }
28750 __struct.temperature_board = buf.get_i8();
28751 for v in &mut __struct.temperature_core {
28752 let val = buf.get_i8();
28753 *v = val;
28754 }
28755 Ok(__struct)
28756 }
28757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28758 let mut __tmp = BytesMut::new(bytes);
28759 #[allow(clippy::absurd_extreme_comparisons)]
28760 #[allow(unused_comparisons)]
28761 if __tmp.remaining() < Self::ENCODED_LEN {
28762 panic!(
28763 "buffer is too small (need {} bytes, but got {})",
28764 Self::ENCODED_LEN,
28765 __tmp.remaining(),
28766 )
28767 }
28768 __tmp.put_u64_le(self.time_usec);
28769 __tmp.put_u32_le(self.uptime);
28770 __tmp.put_u32_le(self.ram_usage);
28771 __tmp.put_u32_le(self.ram_total);
28772 for val in &self.storage_type {
28773 __tmp.put_u32_le(*val);
28774 }
28775 for val in &self.storage_usage {
28776 __tmp.put_u32_le(*val);
28777 }
28778 for val in &self.storage_total {
28779 __tmp.put_u32_le(*val);
28780 }
28781 for val in &self.link_type {
28782 __tmp.put_u32_le(*val);
28783 }
28784 for val in &self.link_tx_rate {
28785 __tmp.put_u32_le(*val);
28786 }
28787 for val in &self.link_rx_rate {
28788 __tmp.put_u32_le(*val);
28789 }
28790 for val in &self.link_tx_max {
28791 __tmp.put_u32_le(*val);
28792 }
28793 for val in &self.link_rx_max {
28794 __tmp.put_u32_le(*val);
28795 }
28796 for val in &self.fan_speed {
28797 __tmp.put_i16_le(*val);
28798 }
28799 __tmp.put_u8(self.mavtype);
28800 for val in &self.cpu_cores {
28801 __tmp.put_u8(*val);
28802 }
28803 for val in &self.cpu_combined {
28804 __tmp.put_u8(*val);
28805 }
28806 for val in &self.gpu_cores {
28807 __tmp.put_u8(*val);
28808 }
28809 for val in &self.gpu_combined {
28810 __tmp.put_u8(*val);
28811 }
28812 __tmp.put_i8(self.temperature_board);
28813 for val in &self.temperature_core {
28814 __tmp.put_i8(*val);
28815 }
28816 if matches!(version, MavlinkVersion::V2) {
28817 let len = __tmp.len();
28818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28819 } else {
28820 __tmp.len()
28821 }
28822 }
28823}
28824#[doc = "id: 12918"]
28825#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
28826#[derive(Debug, Clone, PartialEq)]
28827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28829pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
28830 #[doc = "Status level indicating if arming is allowed."]
28831 pub status: MavOdidArmStatus,
28832 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
28833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28834 pub error: [u8; 50],
28835}
28836impl OPEN_DRONE_ID_ARM_STATUS_DATA {
28837 pub const ENCODED_LEN: usize = 51usize;
28838 pub const DEFAULT: Self = Self {
28839 status: MavOdidArmStatus::DEFAULT,
28840 error: [0_u8; 50usize],
28841 };
28842 #[cfg(feature = "arbitrary")]
28843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28844 use arbitrary::{Arbitrary, Unstructured};
28845 let mut buf = [0u8; 1024];
28846 rng.fill_bytes(&mut buf);
28847 let mut unstructured = Unstructured::new(&buf);
28848 Self::arbitrary(&mut unstructured).unwrap_or_default()
28849 }
28850}
28851impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
28852 fn default() -> Self {
28853 Self::DEFAULT.clone()
28854 }
28855}
28856impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
28857 type Message = MavMessage;
28858 const ID: u32 = 12918u32;
28859 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
28860 const EXTRA_CRC: u8 = 139u8;
28861 const ENCODED_LEN: usize = 51usize;
28862 fn deser(
28863 _version: MavlinkVersion,
28864 __input: &[u8],
28865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28866 let avail_len = __input.len();
28867 let mut payload_buf = [0; Self::ENCODED_LEN];
28868 let mut buf = if avail_len < Self::ENCODED_LEN {
28869 payload_buf[0..avail_len].copy_from_slice(__input);
28870 Bytes::new(&payload_buf)
28871 } else {
28872 Bytes::new(__input)
28873 };
28874 let mut __struct = Self::default();
28875 let tmp = buf.get_u8();
28876 __struct.status =
28877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28878 enum_type: "MavOdidArmStatus",
28879 value: tmp as u32,
28880 })?;
28881 for v in &mut __struct.error {
28882 let val = buf.get_u8();
28883 *v = val;
28884 }
28885 Ok(__struct)
28886 }
28887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28888 let mut __tmp = BytesMut::new(bytes);
28889 #[allow(clippy::absurd_extreme_comparisons)]
28890 #[allow(unused_comparisons)]
28891 if __tmp.remaining() < Self::ENCODED_LEN {
28892 panic!(
28893 "buffer is too small (need {} bytes, but got {})",
28894 Self::ENCODED_LEN,
28895 __tmp.remaining(),
28896 )
28897 }
28898 __tmp.put_u8(self.status as u8);
28899 for val in &self.error {
28900 __tmp.put_u8(*val);
28901 }
28902 if matches!(version, MavlinkVersion::V2) {
28903 let len = __tmp.len();
28904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28905 } else {
28906 __tmp.len()
28907 }
28908 }
28909}
28910#[doc = "id: 12902"]
28911#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
28912#[derive(Debug, Clone, PartialEq)]
28913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28915pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
28916 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
28917 pub timestamp: u32,
28918 #[doc = "System ID (0 for broadcast)."]
28919 pub target_system: u8,
28920 #[doc = "Component ID (0 for broadcast)."]
28921 pub target_component: u8,
28922 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
28923 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28924 pub id_or_mac: [u8; 20],
28925 #[doc = "Indicates the type of authentication."]
28926 pub authentication_type: MavOdidAuthType,
28927 #[doc = "Allowed range is 0 - 15."]
28928 pub data_page: u8,
28929 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
28930 pub last_page_index: u8,
28931 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
28932 pub length: u8,
28933 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
28934 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28935 pub authentication_data: [u8; 23],
28936}
28937impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
28938 pub const ENCODED_LEN: usize = 53usize;
28939 pub const DEFAULT: Self = Self {
28940 timestamp: 0_u32,
28941 target_system: 0_u8,
28942 target_component: 0_u8,
28943 id_or_mac: [0_u8; 20usize],
28944 authentication_type: MavOdidAuthType::DEFAULT,
28945 data_page: 0_u8,
28946 last_page_index: 0_u8,
28947 length: 0_u8,
28948 authentication_data: [0_u8; 23usize],
28949 };
28950 #[cfg(feature = "arbitrary")]
28951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28952 use arbitrary::{Arbitrary, Unstructured};
28953 let mut buf = [0u8; 1024];
28954 rng.fill_bytes(&mut buf);
28955 let mut unstructured = Unstructured::new(&buf);
28956 Self::arbitrary(&mut unstructured).unwrap_or_default()
28957 }
28958}
28959impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
28960 fn default() -> Self {
28961 Self::DEFAULT.clone()
28962 }
28963}
28964impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
28965 type Message = MavMessage;
28966 const ID: u32 = 12902u32;
28967 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
28968 const EXTRA_CRC: u8 = 140u8;
28969 const ENCODED_LEN: usize = 53usize;
28970 fn deser(
28971 _version: MavlinkVersion,
28972 __input: &[u8],
28973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28974 let avail_len = __input.len();
28975 let mut payload_buf = [0; Self::ENCODED_LEN];
28976 let mut buf = if avail_len < Self::ENCODED_LEN {
28977 payload_buf[0..avail_len].copy_from_slice(__input);
28978 Bytes::new(&payload_buf)
28979 } else {
28980 Bytes::new(__input)
28981 };
28982 let mut __struct = Self::default();
28983 __struct.timestamp = buf.get_u32_le();
28984 __struct.target_system = buf.get_u8();
28985 __struct.target_component = buf.get_u8();
28986 for v in &mut __struct.id_or_mac {
28987 let val = buf.get_u8();
28988 *v = val;
28989 }
28990 let tmp = buf.get_u8();
28991 __struct.authentication_type =
28992 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28993 enum_type: "MavOdidAuthType",
28994 value: tmp as u32,
28995 })?;
28996 __struct.data_page = buf.get_u8();
28997 __struct.last_page_index = buf.get_u8();
28998 __struct.length = buf.get_u8();
28999 for v in &mut __struct.authentication_data {
29000 let val = buf.get_u8();
29001 *v = val;
29002 }
29003 Ok(__struct)
29004 }
29005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29006 let mut __tmp = BytesMut::new(bytes);
29007 #[allow(clippy::absurd_extreme_comparisons)]
29008 #[allow(unused_comparisons)]
29009 if __tmp.remaining() < Self::ENCODED_LEN {
29010 panic!(
29011 "buffer is too small (need {} bytes, but got {})",
29012 Self::ENCODED_LEN,
29013 __tmp.remaining(),
29014 )
29015 }
29016 __tmp.put_u32_le(self.timestamp);
29017 __tmp.put_u8(self.target_system);
29018 __tmp.put_u8(self.target_component);
29019 for val in &self.id_or_mac {
29020 __tmp.put_u8(*val);
29021 }
29022 __tmp.put_u8(self.authentication_type as u8);
29023 __tmp.put_u8(self.data_page);
29024 __tmp.put_u8(self.last_page_index);
29025 __tmp.put_u8(self.length);
29026 for val in &self.authentication_data {
29027 __tmp.put_u8(*val);
29028 }
29029 if matches!(version, MavlinkVersion::V2) {
29030 let len = __tmp.len();
29031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29032 } else {
29033 __tmp.len()
29034 }
29035 }
29036}
29037#[doc = "id: 12900"]
29038#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
29039#[derive(Debug, Clone, PartialEq)]
29040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29042pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
29043 #[doc = "System ID (0 for broadcast)."]
29044 pub target_system: u8,
29045 #[doc = "Component ID (0 for broadcast)."]
29046 pub target_component: u8,
29047 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29049 pub id_or_mac: [u8; 20],
29050 #[doc = "Indicates the format for the uas_id field of this message."]
29051 pub id_type: MavOdidIdType,
29052 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
29053 pub ua_type: MavOdidUaType,
29054 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
29055 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29056 pub uas_id: [u8; 20],
29057}
29058impl OPEN_DRONE_ID_BASIC_ID_DATA {
29059 pub const ENCODED_LEN: usize = 44usize;
29060 pub const DEFAULT: Self = Self {
29061 target_system: 0_u8,
29062 target_component: 0_u8,
29063 id_or_mac: [0_u8; 20usize],
29064 id_type: MavOdidIdType::DEFAULT,
29065 ua_type: MavOdidUaType::DEFAULT,
29066 uas_id: [0_u8; 20usize],
29067 };
29068 #[cfg(feature = "arbitrary")]
29069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29070 use arbitrary::{Arbitrary, Unstructured};
29071 let mut buf = [0u8; 1024];
29072 rng.fill_bytes(&mut buf);
29073 let mut unstructured = Unstructured::new(&buf);
29074 Self::arbitrary(&mut unstructured).unwrap_or_default()
29075 }
29076}
29077impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
29078 fn default() -> Self {
29079 Self::DEFAULT.clone()
29080 }
29081}
29082impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
29083 type Message = MavMessage;
29084 const ID: u32 = 12900u32;
29085 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
29086 const EXTRA_CRC: u8 = 114u8;
29087 const ENCODED_LEN: usize = 44usize;
29088 fn deser(
29089 _version: MavlinkVersion,
29090 __input: &[u8],
29091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29092 let avail_len = __input.len();
29093 let mut payload_buf = [0; Self::ENCODED_LEN];
29094 let mut buf = if avail_len < Self::ENCODED_LEN {
29095 payload_buf[0..avail_len].copy_from_slice(__input);
29096 Bytes::new(&payload_buf)
29097 } else {
29098 Bytes::new(__input)
29099 };
29100 let mut __struct = Self::default();
29101 __struct.target_system = buf.get_u8();
29102 __struct.target_component = buf.get_u8();
29103 for v in &mut __struct.id_or_mac {
29104 let val = buf.get_u8();
29105 *v = val;
29106 }
29107 let tmp = buf.get_u8();
29108 __struct.id_type =
29109 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29110 enum_type: "MavOdidIdType",
29111 value: tmp as u32,
29112 })?;
29113 let tmp = buf.get_u8();
29114 __struct.ua_type =
29115 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29116 enum_type: "MavOdidUaType",
29117 value: tmp as u32,
29118 })?;
29119 for v in &mut __struct.uas_id {
29120 let val = buf.get_u8();
29121 *v = val;
29122 }
29123 Ok(__struct)
29124 }
29125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29126 let mut __tmp = BytesMut::new(bytes);
29127 #[allow(clippy::absurd_extreme_comparisons)]
29128 #[allow(unused_comparisons)]
29129 if __tmp.remaining() < Self::ENCODED_LEN {
29130 panic!(
29131 "buffer is too small (need {} bytes, but got {})",
29132 Self::ENCODED_LEN,
29133 __tmp.remaining(),
29134 )
29135 }
29136 __tmp.put_u8(self.target_system);
29137 __tmp.put_u8(self.target_component);
29138 for val in &self.id_or_mac {
29139 __tmp.put_u8(*val);
29140 }
29141 __tmp.put_u8(self.id_type as u8);
29142 __tmp.put_u8(self.ua_type as u8);
29143 for val in &self.uas_id {
29144 __tmp.put_u8(*val);
29145 }
29146 if matches!(version, MavlinkVersion::V2) {
29147 let len = __tmp.len();
29148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29149 } else {
29150 __tmp.len()
29151 }
29152 }
29153}
29154#[doc = "id: 12901"]
29155#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
29156#[derive(Debug, Clone, PartialEq)]
29157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29159pub struct OPEN_DRONE_ID_LOCATION_DATA {
29160 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
29161 pub latitude: i32,
29162 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
29163 pub longitude: i32,
29164 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
29165 pub altitude_barometric: f32,
29166 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
29167 pub altitude_geodetic: f32,
29168 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
29169 pub height: f32,
29170 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
29171 pub timestamp: f32,
29172 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
29173 pub direction: u16,
29174 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
29175 pub speed_horizontal: u16,
29176 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
29177 pub speed_vertical: i16,
29178 #[doc = "System ID (0 for broadcast)."]
29179 pub target_system: u8,
29180 #[doc = "Component ID (0 for broadcast)."]
29181 pub target_component: u8,
29182 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29183 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29184 pub id_or_mac: [u8; 20],
29185 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
29186 pub status: MavOdidStatus,
29187 #[doc = "Indicates the reference point for the height field."]
29188 pub height_reference: MavOdidHeightRef,
29189 #[doc = "The accuracy of the horizontal position."]
29190 pub horizontal_accuracy: MavOdidHorAcc,
29191 #[doc = "The accuracy of the vertical position."]
29192 pub vertical_accuracy: MavOdidVerAcc,
29193 #[doc = "The accuracy of the barometric altitude."]
29194 pub barometer_accuracy: MavOdidVerAcc,
29195 #[doc = "The accuracy of the horizontal and vertical speed."]
29196 pub speed_accuracy: MavOdidSpeedAcc,
29197 #[doc = "The accuracy of the timestamps."]
29198 pub timestamp_accuracy: MavOdidTimeAcc,
29199}
29200impl OPEN_DRONE_ID_LOCATION_DATA {
29201 pub const ENCODED_LEN: usize = 59usize;
29202 pub const DEFAULT: Self = Self {
29203 latitude: 0_i32,
29204 longitude: 0_i32,
29205 altitude_barometric: 0.0_f32,
29206 altitude_geodetic: 0.0_f32,
29207 height: 0.0_f32,
29208 timestamp: 0.0_f32,
29209 direction: 0_u16,
29210 speed_horizontal: 0_u16,
29211 speed_vertical: 0_i16,
29212 target_system: 0_u8,
29213 target_component: 0_u8,
29214 id_or_mac: [0_u8; 20usize],
29215 status: MavOdidStatus::DEFAULT,
29216 height_reference: MavOdidHeightRef::DEFAULT,
29217 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
29218 vertical_accuracy: MavOdidVerAcc::DEFAULT,
29219 barometer_accuracy: MavOdidVerAcc::DEFAULT,
29220 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
29221 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
29222 };
29223 #[cfg(feature = "arbitrary")]
29224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29225 use arbitrary::{Arbitrary, Unstructured};
29226 let mut buf = [0u8; 1024];
29227 rng.fill_bytes(&mut buf);
29228 let mut unstructured = Unstructured::new(&buf);
29229 Self::arbitrary(&mut unstructured).unwrap_or_default()
29230 }
29231}
29232impl Default for OPEN_DRONE_ID_LOCATION_DATA {
29233 fn default() -> Self {
29234 Self::DEFAULT.clone()
29235 }
29236}
29237impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
29238 type Message = MavMessage;
29239 const ID: u32 = 12901u32;
29240 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
29241 const EXTRA_CRC: u8 = 254u8;
29242 const ENCODED_LEN: usize = 59usize;
29243 fn deser(
29244 _version: MavlinkVersion,
29245 __input: &[u8],
29246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29247 let avail_len = __input.len();
29248 let mut payload_buf = [0; Self::ENCODED_LEN];
29249 let mut buf = if avail_len < Self::ENCODED_LEN {
29250 payload_buf[0..avail_len].copy_from_slice(__input);
29251 Bytes::new(&payload_buf)
29252 } else {
29253 Bytes::new(__input)
29254 };
29255 let mut __struct = Self::default();
29256 __struct.latitude = buf.get_i32_le();
29257 __struct.longitude = buf.get_i32_le();
29258 __struct.altitude_barometric = buf.get_f32_le();
29259 __struct.altitude_geodetic = buf.get_f32_le();
29260 __struct.height = buf.get_f32_le();
29261 __struct.timestamp = buf.get_f32_le();
29262 __struct.direction = buf.get_u16_le();
29263 __struct.speed_horizontal = buf.get_u16_le();
29264 __struct.speed_vertical = buf.get_i16_le();
29265 __struct.target_system = buf.get_u8();
29266 __struct.target_component = buf.get_u8();
29267 for v in &mut __struct.id_or_mac {
29268 let val = buf.get_u8();
29269 *v = val;
29270 }
29271 let tmp = buf.get_u8();
29272 __struct.status =
29273 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29274 enum_type: "MavOdidStatus",
29275 value: tmp as u32,
29276 })?;
29277 let tmp = buf.get_u8();
29278 __struct.height_reference =
29279 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29280 enum_type: "MavOdidHeightRef",
29281 value: tmp as u32,
29282 })?;
29283 let tmp = buf.get_u8();
29284 __struct.horizontal_accuracy =
29285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29286 enum_type: "MavOdidHorAcc",
29287 value: tmp as u32,
29288 })?;
29289 let tmp = buf.get_u8();
29290 __struct.vertical_accuracy =
29291 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29292 enum_type: "MavOdidVerAcc",
29293 value: tmp as u32,
29294 })?;
29295 let tmp = buf.get_u8();
29296 __struct.barometer_accuracy =
29297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29298 enum_type: "MavOdidVerAcc",
29299 value: tmp as u32,
29300 })?;
29301 let tmp = buf.get_u8();
29302 __struct.speed_accuracy =
29303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29304 enum_type: "MavOdidSpeedAcc",
29305 value: tmp as u32,
29306 })?;
29307 let tmp = buf.get_u8();
29308 __struct.timestamp_accuracy =
29309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29310 enum_type: "MavOdidTimeAcc",
29311 value: tmp as u32,
29312 })?;
29313 Ok(__struct)
29314 }
29315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29316 let mut __tmp = BytesMut::new(bytes);
29317 #[allow(clippy::absurd_extreme_comparisons)]
29318 #[allow(unused_comparisons)]
29319 if __tmp.remaining() < Self::ENCODED_LEN {
29320 panic!(
29321 "buffer is too small (need {} bytes, but got {})",
29322 Self::ENCODED_LEN,
29323 __tmp.remaining(),
29324 )
29325 }
29326 __tmp.put_i32_le(self.latitude);
29327 __tmp.put_i32_le(self.longitude);
29328 __tmp.put_f32_le(self.altitude_barometric);
29329 __tmp.put_f32_le(self.altitude_geodetic);
29330 __tmp.put_f32_le(self.height);
29331 __tmp.put_f32_le(self.timestamp);
29332 __tmp.put_u16_le(self.direction);
29333 __tmp.put_u16_le(self.speed_horizontal);
29334 __tmp.put_i16_le(self.speed_vertical);
29335 __tmp.put_u8(self.target_system);
29336 __tmp.put_u8(self.target_component);
29337 for val in &self.id_or_mac {
29338 __tmp.put_u8(*val);
29339 }
29340 __tmp.put_u8(self.status as u8);
29341 __tmp.put_u8(self.height_reference as u8);
29342 __tmp.put_u8(self.horizontal_accuracy as u8);
29343 __tmp.put_u8(self.vertical_accuracy as u8);
29344 __tmp.put_u8(self.barometer_accuracy as u8);
29345 __tmp.put_u8(self.speed_accuracy as u8);
29346 __tmp.put_u8(self.timestamp_accuracy as u8);
29347 if matches!(version, MavlinkVersion::V2) {
29348 let len = __tmp.len();
29349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29350 } else {
29351 __tmp.len()
29352 }
29353 }
29354}
29355#[doc = "id: 12915"]
29356#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
29357#[derive(Debug, Clone, PartialEq)]
29358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29360pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
29361 #[doc = "System ID (0 for broadcast)."]
29362 pub target_system: u8,
29363 #[doc = "Component ID (0 for broadcast)."]
29364 pub target_component: u8,
29365 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29366 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29367 pub id_or_mac: [u8; 20],
29368 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
29369 pub single_message_size: u8,
29370 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
29371 pub msg_pack_size: u8,
29372 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
29373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29374 pub messages: [u8; 225],
29375}
29376impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
29377 pub const ENCODED_LEN: usize = 249usize;
29378 pub const DEFAULT: Self = Self {
29379 target_system: 0_u8,
29380 target_component: 0_u8,
29381 id_or_mac: [0_u8; 20usize],
29382 single_message_size: 0_u8,
29383 msg_pack_size: 0_u8,
29384 messages: [0_u8; 225usize],
29385 };
29386 #[cfg(feature = "arbitrary")]
29387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29388 use arbitrary::{Arbitrary, Unstructured};
29389 let mut buf = [0u8; 1024];
29390 rng.fill_bytes(&mut buf);
29391 let mut unstructured = Unstructured::new(&buf);
29392 Self::arbitrary(&mut unstructured).unwrap_or_default()
29393 }
29394}
29395impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
29396 fn default() -> Self {
29397 Self::DEFAULT.clone()
29398 }
29399}
29400impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
29401 type Message = MavMessage;
29402 const ID: u32 = 12915u32;
29403 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
29404 const EXTRA_CRC: u8 = 94u8;
29405 const ENCODED_LEN: usize = 249usize;
29406 fn deser(
29407 _version: MavlinkVersion,
29408 __input: &[u8],
29409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29410 let avail_len = __input.len();
29411 let mut payload_buf = [0; Self::ENCODED_LEN];
29412 let mut buf = if avail_len < Self::ENCODED_LEN {
29413 payload_buf[0..avail_len].copy_from_slice(__input);
29414 Bytes::new(&payload_buf)
29415 } else {
29416 Bytes::new(__input)
29417 };
29418 let mut __struct = Self::default();
29419 __struct.target_system = buf.get_u8();
29420 __struct.target_component = buf.get_u8();
29421 for v in &mut __struct.id_or_mac {
29422 let val = buf.get_u8();
29423 *v = val;
29424 }
29425 __struct.single_message_size = buf.get_u8();
29426 __struct.msg_pack_size = buf.get_u8();
29427 for v in &mut __struct.messages {
29428 let val = buf.get_u8();
29429 *v = val;
29430 }
29431 Ok(__struct)
29432 }
29433 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29434 let mut __tmp = BytesMut::new(bytes);
29435 #[allow(clippy::absurd_extreme_comparisons)]
29436 #[allow(unused_comparisons)]
29437 if __tmp.remaining() < Self::ENCODED_LEN {
29438 panic!(
29439 "buffer is too small (need {} bytes, but got {})",
29440 Self::ENCODED_LEN,
29441 __tmp.remaining(),
29442 )
29443 }
29444 __tmp.put_u8(self.target_system);
29445 __tmp.put_u8(self.target_component);
29446 for val in &self.id_or_mac {
29447 __tmp.put_u8(*val);
29448 }
29449 __tmp.put_u8(self.single_message_size);
29450 __tmp.put_u8(self.msg_pack_size);
29451 for val in &self.messages {
29452 __tmp.put_u8(*val);
29453 }
29454 if matches!(version, MavlinkVersion::V2) {
29455 let len = __tmp.len();
29456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29457 } else {
29458 __tmp.len()
29459 }
29460 }
29461}
29462#[doc = "id: 12905"]
29463#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
29464#[derive(Debug, Clone, PartialEq)]
29465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29467pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
29468 #[doc = "System ID (0 for broadcast)."]
29469 pub target_system: u8,
29470 #[doc = "Component ID (0 for broadcast)."]
29471 pub target_component: u8,
29472 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29474 pub id_or_mac: [u8; 20],
29475 #[doc = "Indicates the type of the operator_id field."]
29476 pub operator_id_type: MavOdidOperatorIdType,
29477 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
29478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29479 pub operator_id: [u8; 20],
29480}
29481impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
29482 pub const ENCODED_LEN: usize = 43usize;
29483 pub const DEFAULT: Self = Self {
29484 target_system: 0_u8,
29485 target_component: 0_u8,
29486 id_or_mac: [0_u8; 20usize],
29487 operator_id_type: MavOdidOperatorIdType::DEFAULT,
29488 operator_id: [0_u8; 20usize],
29489 };
29490 #[cfg(feature = "arbitrary")]
29491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29492 use arbitrary::{Arbitrary, Unstructured};
29493 let mut buf = [0u8; 1024];
29494 rng.fill_bytes(&mut buf);
29495 let mut unstructured = Unstructured::new(&buf);
29496 Self::arbitrary(&mut unstructured).unwrap_or_default()
29497 }
29498}
29499impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
29500 fn default() -> Self {
29501 Self::DEFAULT.clone()
29502 }
29503}
29504impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
29505 type Message = MavMessage;
29506 const ID: u32 = 12905u32;
29507 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
29508 const EXTRA_CRC: u8 = 49u8;
29509 const ENCODED_LEN: usize = 43usize;
29510 fn deser(
29511 _version: MavlinkVersion,
29512 __input: &[u8],
29513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29514 let avail_len = __input.len();
29515 let mut payload_buf = [0; Self::ENCODED_LEN];
29516 let mut buf = if avail_len < Self::ENCODED_LEN {
29517 payload_buf[0..avail_len].copy_from_slice(__input);
29518 Bytes::new(&payload_buf)
29519 } else {
29520 Bytes::new(__input)
29521 };
29522 let mut __struct = Self::default();
29523 __struct.target_system = buf.get_u8();
29524 __struct.target_component = buf.get_u8();
29525 for v in &mut __struct.id_or_mac {
29526 let val = buf.get_u8();
29527 *v = val;
29528 }
29529 let tmp = buf.get_u8();
29530 __struct.operator_id_type =
29531 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29532 enum_type: "MavOdidOperatorIdType",
29533 value: tmp as u32,
29534 })?;
29535 for v in &mut __struct.operator_id {
29536 let val = buf.get_u8();
29537 *v = val;
29538 }
29539 Ok(__struct)
29540 }
29541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29542 let mut __tmp = BytesMut::new(bytes);
29543 #[allow(clippy::absurd_extreme_comparisons)]
29544 #[allow(unused_comparisons)]
29545 if __tmp.remaining() < Self::ENCODED_LEN {
29546 panic!(
29547 "buffer is too small (need {} bytes, but got {})",
29548 Self::ENCODED_LEN,
29549 __tmp.remaining(),
29550 )
29551 }
29552 __tmp.put_u8(self.target_system);
29553 __tmp.put_u8(self.target_component);
29554 for val in &self.id_or_mac {
29555 __tmp.put_u8(*val);
29556 }
29557 __tmp.put_u8(self.operator_id_type as u8);
29558 for val in &self.operator_id {
29559 __tmp.put_u8(*val);
29560 }
29561 if matches!(version, MavlinkVersion::V2) {
29562 let len = __tmp.len();
29563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29564 } else {
29565 __tmp.len()
29566 }
29567 }
29568}
29569#[doc = "id: 12903"]
29570#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
29571#[derive(Debug, Clone, PartialEq)]
29572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29574pub struct OPEN_DRONE_ID_SELF_ID_DATA {
29575 #[doc = "System ID (0 for broadcast)."]
29576 pub target_system: u8,
29577 #[doc = "Component ID (0 for broadcast)."]
29578 pub target_component: u8,
29579 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29581 pub id_or_mac: [u8; 20],
29582 #[doc = "Indicates the type of the description field."]
29583 pub description_type: MavOdidDescType,
29584 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
29585 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29586 pub description: [u8; 23],
29587}
29588impl OPEN_DRONE_ID_SELF_ID_DATA {
29589 pub const ENCODED_LEN: usize = 46usize;
29590 pub const DEFAULT: Self = Self {
29591 target_system: 0_u8,
29592 target_component: 0_u8,
29593 id_or_mac: [0_u8; 20usize],
29594 description_type: MavOdidDescType::DEFAULT,
29595 description: [0_u8; 23usize],
29596 };
29597 #[cfg(feature = "arbitrary")]
29598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29599 use arbitrary::{Arbitrary, Unstructured};
29600 let mut buf = [0u8; 1024];
29601 rng.fill_bytes(&mut buf);
29602 let mut unstructured = Unstructured::new(&buf);
29603 Self::arbitrary(&mut unstructured).unwrap_or_default()
29604 }
29605}
29606impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
29607 fn default() -> Self {
29608 Self::DEFAULT.clone()
29609 }
29610}
29611impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
29612 type Message = MavMessage;
29613 const ID: u32 = 12903u32;
29614 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
29615 const EXTRA_CRC: u8 = 249u8;
29616 const ENCODED_LEN: usize = 46usize;
29617 fn deser(
29618 _version: MavlinkVersion,
29619 __input: &[u8],
29620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29621 let avail_len = __input.len();
29622 let mut payload_buf = [0; Self::ENCODED_LEN];
29623 let mut buf = if avail_len < Self::ENCODED_LEN {
29624 payload_buf[0..avail_len].copy_from_slice(__input);
29625 Bytes::new(&payload_buf)
29626 } else {
29627 Bytes::new(__input)
29628 };
29629 let mut __struct = Self::default();
29630 __struct.target_system = buf.get_u8();
29631 __struct.target_component = buf.get_u8();
29632 for v in &mut __struct.id_or_mac {
29633 let val = buf.get_u8();
29634 *v = val;
29635 }
29636 let tmp = buf.get_u8();
29637 __struct.description_type =
29638 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29639 enum_type: "MavOdidDescType",
29640 value: tmp as u32,
29641 })?;
29642 for v in &mut __struct.description {
29643 let val = buf.get_u8();
29644 *v = val;
29645 }
29646 Ok(__struct)
29647 }
29648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29649 let mut __tmp = BytesMut::new(bytes);
29650 #[allow(clippy::absurd_extreme_comparisons)]
29651 #[allow(unused_comparisons)]
29652 if __tmp.remaining() < Self::ENCODED_LEN {
29653 panic!(
29654 "buffer is too small (need {} bytes, but got {})",
29655 Self::ENCODED_LEN,
29656 __tmp.remaining(),
29657 )
29658 }
29659 __tmp.put_u8(self.target_system);
29660 __tmp.put_u8(self.target_component);
29661 for val in &self.id_or_mac {
29662 __tmp.put_u8(*val);
29663 }
29664 __tmp.put_u8(self.description_type as u8);
29665 for val in &self.description {
29666 __tmp.put_u8(*val);
29667 }
29668 if matches!(version, MavlinkVersion::V2) {
29669 let len = __tmp.len();
29670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29671 } else {
29672 __tmp.len()
29673 }
29674 }
29675}
29676#[doc = "id: 12904"]
29677#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
29678#[derive(Debug, Clone, PartialEq)]
29679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29681pub struct OPEN_DRONE_ID_SYSTEM_DATA {
29682 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
29683 pub operator_latitude: i32,
29684 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
29685 pub operator_longitude: i32,
29686 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
29687 pub area_ceiling: f32,
29688 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
29689 pub area_floor: f32,
29690 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
29691 pub operator_altitude_geo: f32,
29692 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
29693 pub timestamp: u32,
29694 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
29695 pub area_count: u16,
29696 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
29697 pub area_radius: u16,
29698 #[doc = "System ID (0 for broadcast)."]
29699 pub target_system: u8,
29700 #[doc = "Component ID (0 for broadcast)."]
29701 pub target_component: u8,
29702 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29704 pub id_or_mac: [u8; 20],
29705 #[doc = "Specifies the operator location type."]
29706 pub operator_location_type: MavOdidOperatorLocationType,
29707 #[doc = "Specifies the classification type of the UA."]
29708 pub classification_type: MavOdidClassificationType,
29709 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
29710 pub category_eu: MavOdidCategoryEu,
29711 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
29712 pub class_eu: MavOdidClassEu,
29713}
29714impl OPEN_DRONE_ID_SYSTEM_DATA {
29715 pub const ENCODED_LEN: usize = 54usize;
29716 pub const DEFAULT: Self = Self {
29717 operator_latitude: 0_i32,
29718 operator_longitude: 0_i32,
29719 area_ceiling: 0.0_f32,
29720 area_floor: 0.0_f32,
29721 operator_altitude_geo: 0.0_f32,
29722 timestamp: 0_u32,
29723 area_count: 0_u16,
29724 area_radius: 0_u16,
29725 target_system: 0_u8,
29726 target_component: 0_u8,
29727 id_or_mac: [0_u8; 20usize],
29728 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
29729 classification_type: MavOdidClassificationType::DEFAULT,
29730 category_eu: MavOdidCategoryEu::DEFAULT,
29731 class_eu: MavOdidClassEu::DEFAULT,
29732 };
29733 #[cfg(feature = "arbitrary")]
29734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29735 use arbitrary::{Arbitrary, Unstructured};
29736 let mut buf = [0u8; 1024];
29737 rng.fill_bytes(&mut buf);
29738 let mut unstructured = Unstructured::new(&buf);
29739 Self::arbitrary(&mut unstructured).unwrap_or_default()
29740 }
29741}
29742impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
29743 fn default() -> Self {
29744 Self::DEFAULT.clone()
29745 }
29746}
29747impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
29748 type Message = MavMessage;
29749 const ID: u32 = 12904u32;
29750 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
29751 const EXTRA_CRC: u8 = 77u8;
29752 const ENCODED_LEN: usize = 54usize;
29753 fn deser(
29754 _version: MavlinkVersion,
29755 __input: &[u8],
29756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29757 let avail_len = __input.len();
29758 let mut payload_buf = [0; Self::ENCODED_LEN];
29759 let mut buf = if avail_len < Self::ENCODED_LEN {
29760 payload_buf[0..avail_len].copy_from_slice(__input);
29761 Bytes::new(&payload_buf)
29762 } else {
29763 Bytes::new(__input)
29764 };
29765 let mut __struct = Self::default();
29766 __struct.operator_latitude = buf.get_i32_le();
29767 __struct.operator_longitude = buf.get_i32_le();
29768 __struct.area_ceiling = buf.get_f32_le();
29769 __struct.area_floor = buf.get_f32_le();
29770 __struct.operator_altitude_geo = buf.get_f32_le();
29771 __struct.timestamp = buf.get_u32_le();
29772 __struct.area_count = buf.get_u16_le();
29773 __struct.area_radius = buf.get_u16_le();
29774 __struct.target_system = buf.get_u8();
29775 __struct.target_component = buf.get_u8();
29776 for v in &mut __struct.id_or_mac {
29777 let val = buf.get_u8();
29778 *v = val;
29779 }
29780 let tmp = buf.get_u8();
29781 __struct.operator_location_type =
29782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29783 enum_type: "MavOdidOperatorLocationType",
29784 value: tmp as u32,
29785 })?;
29786 let tmp = buf.get_u8();
29787 __struct.classification_type =
29788 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29789 enum_type: "MavOdidClassificationType",
29790 value: tmp as u32,
29791 })?;
29792 let tmp = buf.get_u8();
29793 __struct.category_eu =
29794 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29795 enum_type: "MavOdidCategoryEu",
29796 value: tmp as u32,
29797 })?;
29798 let tmp = buf.get_u8();
29799 __struct.class_eu =
29800 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29801 enum_type: "MavOdidClassEu",
29802 value: tmp as u32,
29803 })?;
29804 Ok(__struct)
29805 }
29806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29807 let mut __tmp = BytesMut::new(bytes);
29808 #[allow(clippy::absurd_extreme_comparisons)]
29809 #[allow(unused_comparisons)]
29810 if __tmp.remaining() < Self::ENCODED_LEN {
29811 panic!(
29812 "buffer is too small (need {} bytes, but got {})",
29813 Self::ENCODED_LEN,
29814 __tmp.remaining(),
29815 )
29816 }
29817 __tmp.put_i32_le(self.operator_latitude);
29818 __tmp.put_i32_le(self.operator_longitude);
29819 __tmp.put_f32_le(self.area_ceiling);
29820 __tmp.put_f32_le(self.area_floor);
29821 __tmp.put_f32_le(self.operator_altitude_geo);
29822 __tmp.put_u32_le(self.timestamp);
29823 __tmp.put_u16_le(self.area_count);
29824 __tmp.put_u16_le(self.area_radius);
29825 __tmp.put_u8(self.target_system);
29826 __tmp.put_u8(self.target_component);
29827 for val in &self.id_or_mac {
29828 __tmp.put_u8(*val);
29829 }
29830 __tmp.put_u8(self.operator_location_type as u8);
29831 __tmp.put_u8(self.classification_type as u8);
29832 __tmp.put_u8(self.category_eu as u8);
29833 __tmp.put_u8(self.class_eu as u8);
29834 if matches!(version, MavlinkVersion::V2) {
29835 let len = __tmp.len();
29836 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29837 } else {
29838 __tmp.len()
29839 }
29840 }
29841}
29842#[doc = "id: 12919"]
29843#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
29844#[derive(Debug, Clone, PartialEq)]
29845#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29847pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
29848 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
29849 pub operator_latitude: i32,
29850 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
29851 pub operator_longitude: i32,
29852 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
29853 pub operator_altitude_geo: f32,
29854 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
29855 pub timestamp: u32,
29856 #[doc = "System ID (0 for broadcast)."]
29857 pub target_system: u8,
29858 #[doc = "Component ID (0 for broadcast)."]
29859 pub target_component: u8,
29860}
29861impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
29862 pub const ENCODED_LEN: usize = 18usize;
29863 pub const DEFAULT: Self = Self {
29864 operator_latitude: 0_i32,
29865 operator_longitude: 0_i32,
29866 operator_altitude_geo: 0.0_f32,
29867 timestamp: 0_u32,
29868 target_system: 0_u8,
29869 target_component: 0_u8,
29870 };
29871 #[cfg(feature = "arbitrary")]
29872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29873 use arbitrary::{Arbitrary, Unstructured};
29874 let mut buf = [0u8; 1024];
29875 rng.fill_bytes(&mut buf);
29876 let mut unstructured = Unstructured::new(&buf);
29877 Self::arbitrary(&mut unstructured).unwrap_or_default()
29878 }
29879}
29880impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
29881 fn default() -> Self {
29882 Self::DEFAULT.clone()
29883 }
29884}
29885impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
29886 type Message = MavMessage;
29887 const ID: u32 = 12919u32;
29888 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
29889 const EXTRA_CRC: u8 = 7u8;
29890 const ENCODED_LEN: usize = 18usize;
29891 fn deser(
29892 _version: MavlinkVersion,
29893 __input: &[u8],
29894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29895 let avail_len = __input.len();
29896 let mut payload_buf = [0; Self::ENCODED_LEN];
29897 let mut buf = if avail_len < Self::ENCODED_LEN {
29898 payload_buf[0..avail_len].copy_from_slice(__input);
29899 Bytes::new(&payload_buf)
29900 } else {
29901 Bytes::new(__input)
29902 };
29903 let mut __struct = Self::default();
29904 __struct.operator_latitude = buf.get_i32_le();
29905 __struct.operator_longitude = buf.get_i32_le();
29906 __struct.operator_altitude_geo = buf.get_f32_le();
29907 __struct.timestamp = buf.get_u32_le();
29908 __struct.target_system = buf.get_u8();
29909 __struct.target_component = buf.get_u8();
29910 Ok(__struct)
29911 }
29912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29913 let mut __tmp = BytesMut::new(bytes);
29914 #[allow(clippy::absurd_extreme_comparisons)]
29915 #[allow(unused_comparisons)]
29916 if __tmp.remaining() < Self::ENCODED_LEN {
29917 panic!(
29918 "buffer is too small (need {} bytes, but got {})",
29919 Self::ENCODED_LEN,
29920 __tmp.remaining(),
29921 )
29922 }
29923 __tmp.put_i32_le(self.operator_latitude);
29924 __tmp.put_i32_le(self.operator_longitude);
29925 __tmp.put_f32_le(self.operator_altitude_geo);
29926 __tmp.put_u32_le(self.timestamp);
29927 __tmp.put_u8(self.target_system);
29928 __tmp.put_u8(self.target_component);
29929 if matches!(version, MavlinkVersion::V2) {
29930 let len = __tmp.len();
29931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29932 } else {
29933 __tmp.len()
29934 }
29935 }
29936}
29937#[doc = "id: 100"]
29938#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
29939#[derive(Debug, Clone, PartialEq)]
29940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29942pub struct OPTICAL_FLOW_DATA {
29943 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29944 pub time_usec: u64,
29945 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
29946 pub flow_comp_m_x: f32,
29947 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
29948 pub flow_comp_m_y: f32,
29949 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
29950 pub ground_distance: f32,
29951 #[doc = "Flow in x-sensor direction"]
29952 pub flow_x: i16,
29953 #[doc = "Flow in y-sensor direction"]
29954 pub flow_y: i16,
29955 #[doc = "Sensor ID"]
29956 pub sensor_id: u8,
29957 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
29958 pub quality: u8,
29959 #[doc = "Flow rate about X axis"]
29960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29961 pub flow_rate_x: f32,
29962 #[doc = "Flow rate about Y axis"]
29963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29964 pub flow_rate_y: f32,
29965}
29966impl OPTICAL_FLOW_DATA {
29967 pub const ENCODED_LEN: usize = 34usize;
29968 pub const DEFAULT: Self = Self {
29969 time_usec: 0_u64,
29970 flow_comp_m_x: 0.0_f32,
29971 flow_comp_m_y: 0.0_f32,
29972 ground_distance: 0.0_f32,
29973 flow_x: 0_i16,
29974 flow_y: 0_i16,
29975 sensor_id: 0_u8,
29976 quality: 0_u8,
29977 flow_rate_x: 0.0_f32,
29978 flow_rate_y: 0.0_f32,
29979 };
29980 #[cfg(feature = "arbitrary")]
29981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29982 use arbitrary::{Arbitrary, Unstructured};
29983 let mut buf = [0u8; 1024];
29984 rng.fill_bytes(&mut buf);
29985 let mut unstructured = Unstructured::new(&buf);
29986 Self::arbitrary(&mut unstructured).unwrap_or_default()
29987 }
29988}
29989impl Default for OPTICAL_FLOW_DATA {
29990 fn default() -> Self {
29991 Self::DEFAULT.clone()
29992 }
29993}
29994impl MessageData for OPTICAL_FLOW_DATA {
29995 type Message = MavMessage;
29996 const ID: u32 = 100u32;
29997 const NAME: &'static str = "OPTICAL_FLOW";
29998 const EXTRA_CRC: u8 = 175u8;
29999 const ENCODED_LEN: usize = 34usize;
30000 fn deser(
30001 _version: MavlinkVersion,
30002 __input: &[u8],
30003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30004 let avail_len = __input.len();
30005 let mut payload_buf = [0; Self::ENCODED_LEN];
30006 let mut buf = if avail_len < Self::ENCODED_LEN {
30007 payload_buf[0..avail_len].copy_from_slice(__input);
30008 Bytes::new(&payload_buf)
30009 } else {
30010 Bytes::new(__input)
30011 };
30012 let mut __struct = Self::default();
30013 __struct.time_usec = buf.get_u64_le();
30014 __struct.flow_comp_m_x = buf.get_f32_le();
30015 __struct.flow_comp_m_y = buf.get_f32_le();
30016 __struct.ground_distance = buf.get_f32_le();
30017 __struct.flow_x = buf.get_i16_le();
30018 __struct.flow_y = buf.get_i16_le();
30019 __struct.sensor_id = buf.get_u8();
30020 __struct.quality = buf.get_u8();
30021 __struct.flow_rate_x = buf.get_f32_le();
30022 __struct.flow_rate_y = buf.get_f32_le();
30023 Ok(__struct)
30024 }
30025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30026 let mut __tmp = BytesMut::new(bytes);
30027 #[allow(clippy::absurd_extreme_comparisons)]
30028 #[allow(unused_comparisons)]
30029 if __tmp.remaining() < Self::ENCODED_LEN {
30030 panic!(
30031 "buffer is too small (need {} bytes, but got {})",
30032 Self::ENCODED_LEN,
30033 __tmp.remaining(),
30034 )
30035 }
30036 __tmp.put_u64_le(self.time_usec);
30037 __tmp.put_f32_le(self.flow_comp_m_x);
30038 __tmp.put_f32_le(self.flow_comp_m_y);
30039 __tmp.put_f32_le(self.ground_distance);
30040 __tmp.put_i16_le(self.flow_x);
30041 __tmp.put_i16_le(self.flow_y);
30042 __tmp.put_u8(self.sensor_id);
30043 __tmp.put_u8(self.quality);
30044 __tmp.put_f32_le(self.flow_rate_x);
30045 __tmp.put_f32_le(self.flow_rate_y);
30046 if matches!(version, MavlinkVersion::V2) {
30047 let len = __tmp.len();
30048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30049 } else {
30050 __tmp.len()
30051 }
30052 }
30053}
30054#[doc = "id: 106"]
30055#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
30056#[derive(Debug, Clone, PartialEq)]
30057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30059pub struct OPTICAL_FLOW_RAD_DATA {
30060 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30061 pub time_usec: u64,
30062 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
30063 pub integration_time_us: u32,
30064 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
30065 pub integrated_x: f32,
30066 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
30067 pub integrated_y: f32,
30068 #[doc = "RH rotation around X axis"]
30069 pub integrated_xgyro: f32,
30070 #[doc = "RH rotation around Y axis"]
30071 pub integrated_ygyro: f32,
30072 #[doc = "RH rotation around Z axis"]
30073 pub integrated_zgyro: f32,
30074 #[doc = "Time since the distance was sampled."]
30075 pub time_delta_distance_us: u32,
30076 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
30077 pub distance: f32,
30078 #[doc = "Temperature"]
30079 pub temperature: i16,
30080 #[doc = "Sensor ID"]
30081 pub sensor_id: u8,
30082 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
30083 pub quality: u8,
30084}
30085impl OPTICAL_FLOW_RAD_DATA {
30086 pub const ENCODED_LEN: usize = 44usize;
30087 pub const DEFAULT: Self = Self {
30088 time_usec: 0_u64,
30089 integration_time_us: 0_u32,
30090 integrated_x: 0.0_f32,
30091 integrated_y: 0.0_f32,
30092 integrated_xgyro: 0.0_f32,
30093 integrated_ygyro: 0.0_f32,
30094 integrated_zgyro: 0.0_f32,
30095 time_delta_distance_us: 0_u32,
30096 distance: 0.0_f32,
30097 temperature: 0_i16,
30098 sensor_id: 0_u8,
30099 quality: 0_u8,
30100 };
30101 #[cfg(feature = "arbitrary")]
30102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30103 use arbitrary::{Arbitrary, Unstructured};
30104 let mut buf = [0u8; 1024];
30105 rng.fill_bytes(&mut buf);
30106 let mut unstructured = Unstructured::new(&buf);
30107 Self::arbitrary(&mut unstructured).unwrap_or_default()
30108 }
30109}
30110impl Default for OPTICAL_FLOW_RAD_DATA {
30111 fn default() -> Self {
30112 Self::DEFAULT.clone()
30113 }
30114}
30115impl MessageData for OPTICAL_FLOW_RAD_DATA {
30116 type Message = MavMessage;
30117 const ID: u32 = 106u32;
30118 const NAME: &'static str = "OPTICAL_FLOW_RAD";
30119 const EXTRA_CRC: u8 = 138u8;
30120 const ENCODED_LEN: usize = 44usize;
30121 fn deser(
30122 _version: MavlinkVersion,
30123 __input: &[u8],
30124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30125 let avail_len = __input.len();
30126 let mut payload_buf = [0; Self::ENCODED_LEN];
30127 let mut buf = if avail_len < Self::ENCODED_LEN {
30128 payload_buf[0..avail_len].copy_from_slice(__input);
30129 Bytes::new(&payload_buf)
30130 } else {
30131 Bytes::new(__input)
30132 };
30133 let mut __struct = Self::default();
30134 __struct.time_usec = buf.get_u64_le();
30135 __struct.integration_time_us = buf.get_u32_le();
30136 __struct.integrated_x = buf.get_f32_le();
30137 __struct.integrated_y = buf.get_f32_le();
30138 __struct.integrated_xgyro = buf.get_f32_le();
30139 __struct.integrated_ygyro = buf.get_f32_le();
30140 __struct.integrated_zgyro = buf.get_f32_le();
30141 __struct.time_delta_distance_us = buf.get_u32_le();
30142 __struct.distance = buf.get_f32_le();
30143 __struct.temperature = buf.get_i16_le();
30144 __struct.sensor_id = buf.get_u8();
30145 __struct.quality = buf.get_u8();
30146 Ok(__struct)
30147 }
30148 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30149 let mut __tmp = BytesMut::new(bytes);
30150 #[allow(clippy::absurd_extreme_comparisons)]
30151 #[allow(unused_comparisons)]
30152 if __tmp.remaining() < Self::ENCODED_LEN {
30153 panic!(
30154 "buffer is too small (need {} bytes, but got {})",
30155 Self::ENCODED_LEN,
30156 __tmp.remaining(),
30157 )
30158 }
30159 __tmp.put_u64_le(self.time_usec);
30160 __tmp.put_u32_le(self.integration_time_us);
30161 __tmp.put_f32_le(self.integrated_x);
30162 __tmp.put_f32_le(self.integrated_y);
30163 __tmp.put_f32_le(self.integrated_xgyro);
30164 __tmp.put_f32_le(self.integrated_ygyro);
30165 __tmp.put_f32_le(self.integrated_zgyro);
30166 __tmp.put_u32_le(self.time_delta_distance_us);
30167 __tmp.put_f32_le(self.distance);
30168 __tmp.put_i16_le(self.temperature);
30169 __tmp.put_u8(self.sensor_id);
30170 __tmp.put_u8(self.quality);
30171 if matches!(version, MavlinkVersion::V2) {
30172 let len = __tmp.len();
30173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30174 } else {
30175 __tmp.len()
30176 }
30177 }
30178}
30179#[doc = "id: 360"]
30180#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
30181#[derive(Debug, Clone, PartialEq)]
30182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30184pub struct ORBIT_EXECUTION_STATUS_DATA {
30185 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30186 pub time_usec: u64,
30187 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
30188 pub radius: f32,
30189 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
30190 pub x: i32,
30191 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
30192 pub y: i32,
30193 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
30194 pub z: f32,
30195 #[doc = "The coordinate system of the fields: x, y, z."]
30196 pub frame: MavFrame,
30197}
30198impl ORBIT_EXECUTION_STATUS_DATA {
30199 pub const ENCODED_LEN: usize = 25usize;
30200 pub const DEFAULT: Self = Self {
30201 time_usec: 0_u64,
30202 radius: 0.0_f32,
30203 x: 0_i32,
30204 y: 0_i32,
30205 z: 0.0_f32,
30206 frame: MavFrame::DEFAULT,
30207 };
30208 #[cfg(feature = "arbitrary")]
30209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30210 use arbitrary::{Arbitrary, Unstructured};
30211 let mut buf = [0u8; 1024];
30212 rng.fill_bytes(&mut buf);
30213 let mut unstructured = Unstructured::new(&buf);
30214 Self::arbitrary(&mut unstructured).unwrap_or_default()
30215 }
30216}
30217impl Default for ORBIT_EXECUTION_STATUS_DATA {
30218 fn default() -> Self {
30219 Self::DEFAULT.clone()
30220 }
30221}
30222impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
30223 type Message = MavMessage;
30224 const ID: u32 = 360u32;
30225 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
30226 const EXTRA_CRC: u8 = 11u8;
30227 const ENCODED_LEN: usize = 25usize;
30228 fn deser(
30229 _version: MavlinkVersion,
30230 __input: &[u8],
30231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30232 let avail_len = __input.len();
30233 let mut payload_buf = [0; Self::ENCODED_LEN];
30234 let mut buf = if avail_len < Self::ENCODED_LEN {
30235 payload_buf[0..avail_len].copy_from_slice(__input);
30236 Bytes::new(&payload_buf)
30237 } else {
30238 Bytes::new(__input)
30239 };
30240 let mut __struct = Self::default();
30241 __struct.time_usec = buf.get_u64_le();
30242 __struct.radius = buf.get_f32_le();
30243 __struct.x = buf.get_i32_le();
30244 __struct.y = buf.get_i32_le();
30245 __struct.z = buf.get_f32_le();
30246 let tmp = buf.get_u8();
30247 __struct.frame =
30248 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30249 enum_type: "MavFrame",
30250 value: tmp as u32,
30251 })?;
30252 Ok(__struct)
30253 }
30254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30255 let mut __tmp = BytesMut::new(bytes);
30256 #[allow(clippy::absurd_extreme_comparisons)]
30257 #[allow(unused_comparisons)]
30258 if __tmp.remaining() < Self::ENCODED_LEN {
30259 panic!(
30260 "buffer is too small (need {} bytes, but got {})",
30261 Self::ENCODED_LEN,
30262 __tmp.remaining(),
30263 )
30264 }
30265 __tmp.put_u64_le(self.time_usec);
30266 __tmp.put_f32_le(self.radius);
30267 __tmp.put_i32_le(self.x);
30268 __tmp.put_i32_le(self.y);
30269 __tmp.put_f32_le(self.z);
30270 __tmp.put_u8(self.frame as u8);
30271 if matches!(version, MavlinkVersion::V2) {
30272 let len = __tmp.len();
30273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30274 } else {
30275 __tmp.len()
30276 }
30277 }
30278}
30279#[doc = "id: 11033"]
30280#[doc = "Configure an OSD parameter slot."]
30281#[derive(Debug, Clone, PartialEq)]
30282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30284pub struct OSD_PARAM_CONFIG_DATA {
30285 #[doc = "Request ID - copied to reply."]
30286 pub request_id: u32,
30287 #[doc = "OSD parameter minimum value."]
30288 pub min_value: f32,
30289 #[doc = "OSD parameter maximum value."]
30290 pub max_value: f32,
30291 #[doc = "OSD parameter increment."]
30292 pub increment: f32,
30293 #[doc = "System ID."]
30294 pub target_system: u8,
30295 #[doc = "Component ID."]
30296 pub target_component: u8,
30297 #[doc = "OSD parameter screen index."]
30298 pub osd_screen: u8,
30299 #[doc = "OSD parameter display index."]
30300 pub osd_index: u8,
30301 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30302 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30303 pub param_id: [u8; 16],
30304 #[doc = "Config type."]
30305 pub config_type: OsdParamConfigType,
30306}
30307impl OSD_PARAM_CONFIG_DATA {
30308 pub const ENCODED_LEN: usize = 37usize;
30309 pub const DEFAULT: Self = Self {
30310 request_id: 0_u32,
30311 min_value: 0.0_f32,
30312 max_value: 0.0_f32,
30313 increment: 0.0_f32,
30314 target_system: 0_u8,
30315 target_component: 0_u8,
30316 osd_screen: 0_u8,
30317 osd_index: 0_u8,
30318 param_id: [0_u8; 16usize],
30319 config_type: OsdParamConfigType::DEFAULT,
30320 };
30321 #[cfg(feature = "arbitrary")]
30322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30323 use arbitrary::{Arbitrary, Unstructured};
30324 let mut buf = [0u8; 1024];
30325 rng.fill_bytes(&mut buf);
30326 let mut unstructured = Unstructured::new(&buf);
30327 Self::arbitrary(&mut unstructured).unwrap_or_default()
30328 }
30329}
30330impl Default for OSD_PARAM_CONFIG_DATA {
30331 fn default() -> Self {
30332 Self::DEFAULT.clone()
30333 }
30334}
30335impl MessageData for OSD_PARAM_CONFIG_DATA {
30336 type Message = MavMessage;
30337 const ID: u32 = 11033u32;
30338 const NAME: &'static str = "OSD_PARAM_CONFIG";
30339 const EXTRA_CRC: u8 = 195u8;
30340 const ENCODED_LEN: usize = 37usize;
30341 fn deser(
30342 _version: MavlinkVersion,
30343 __input: &[u8],
30344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30345 let avail_len = __input.len();
30346 let mut payload_buf = [0; Self::ENCODED_LEN];
30347 let mut buf = if avail_len < Self::ENCODED_LEN {
30348 payload_buf[0..avail_len].copy_from_slice(__input);
30349 Bytes::new(&payload_buf)
30350 } else {
30351 Bytes::new(__input)
30352 };
30353 let mut __struct = Self::default();
30354 __struct.request_id = buf.get_u32_le();
30355 __struct.min_value = buf.get_f32_le();
30356 __struct.max_value = buf.get_f32_le();
30357 __struct.increment = buf.get_f32_le();
30358 __struct.target_system = buf.get_u8();
30359 __struct.target_component = buf.get_u8();
30360 __struct.osd_screen = buf.get_u8();
30361 __struct.osd_index = buf.get_u8();
30362 for v in &mut __struct.param_id {
30363 let val = buf.get_u8();
30364 *v = val;
30365 }
30366 let tmp = buf.get_u8();
30367 __struct.config_type =
30368 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30369 enum_type: "OsdParamConfigType",
30370 value: tmp as u32,
30371 })?;
30372 Ok(__struct)
30373 }
30374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30375 let mut __tmp = BytesMut::new(bytes);
30376 #[allow(clippy::absurd_extreme_comparisons)]
30377 #[allow(unused_comparisons)]
30378 if __tmp.remaining() < Self::ENCODED_LEN {
30379 panic!(
30380 "buffer is too small (need {} bytes, but got {})",
30381 Self::ENCODED_LEN,
30382 __tmp.remaining(),
30383 )
30384 }
30385 __tmp.put_u32_le(self.request_id);
30386 __tmp.put_f32_le(self.min_value);
30387 __tmp.put_f32_le(self.max_value);
30388 __tmp.put_f32_le(self.increment);
30389 __tmp.put_u8(self.target_system);
30390 __tmp.put_u8(self.target_component);
30391 __tmp.put_u8(self.osd_screen);
30392 __tmp.put_u8(self.osd_index);
30393 for val in &self.param_id {
30394 __tmp.put_u8(*val);
30395 }
30396 __tmp.put_u8(self.config_type as u8);
30397 if matches!(version, MavlinkVersion::V2) {
30398 let len = __tmp.len();
30399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30400 } else {
30401 __tmp.len()
30402 }
30403 }
30404}
30405#[doc = "id: 11034"]
30406#[doc = "Configure OSD parameter reply."]
30407#[derive(Debug, Clone, PartialEq)]
30408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30410pub struct OSD_PARAM_CONFIG_REPLY_DATA {
30411 #[doc = "Request ID - copied from request."]
30412 pub request_id: u32,
30413 #[doc = "Config error type."]
30414 pub result: OsdParamConfigError,
30415}
30416impl OSD_PARAM_CONFIG_REPLY_DATA {
30417 pub const ENCODED_LEN: usize = 5usize;
30418 pub const DEFAULT: Self = Self {
30419 request_id: 0_u32,
30420 result: OsdParamConfigError::DEFAULT,
30421 };
30422 #[cfg(feature = "arbitrary")]
30423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30424 use arbitrary::{Arbitrary, Unstructured};
30425 let mut buf = [0u8; 1024];
30426 rng.fill_bytes(&mut buf);
30427 let mut unstructured = Unstructured::new(&buf);
30428 Self::arbitrary(&mut unstructured).unwrap_or_default()
30429 }
30430}
30431impl Default for OSD_PARAM_CONFIG_REPLY_DATA {
30432 fn default() -> Self {
30433 Self::DEFAULT.clone()
30434 }
30435}
30436impl MessageData for OSD_PARAM_CONFIG_REPLY_DATA {
30437 type Message = MavMessage;
30438 const ID: u32 = 11034u32;
30439 const NAME: &'static str = "OSD_PARAM_CONFIG_REPLY";
30440 const EXTRA_CRC: u8 = 79u8;
30441 const ENCODED_LEN: usize = 5usize;
30442 fn deser(
30443 _version: MavlinkVersion,
30444 __input: &[u8],
30445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30446 let avail_len = __input.len();
30447 let mut payload_buf = [0; Self::ENCODED_LEN];
30448 let mut buf = if avail_len < Self::ENCODED_LEN {
30449 payload_buf[0..avail_len].copy_from_slice(__input);
30450 Bytes::new(&payload_buf)
30451 } else {
30452 Bytes::new(__input)
30453 };
30454 let mut __struct = Self::default();
30455 __struct.request_id = buf.get_u32_le();
30456 let tmp = buf.get_u8();
30457 __struct.result =
30458 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30459 enum_type: "OsdParamConfigError",
30460 value: tmp as u32,
30461 })?;
30462 Ok(__struct)
30463 }
30464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30465 let mut __tmp = BytesMut::new(bytes);
30466 #[allow(clippy::absurd_extreme_comparisons)]
30467 #[allow(unused_comparisons)]
30468 if __tmp.remaining() < Self::ENCODED_LEN {
30469 panic!(
30470 "buffer is too small (need {} bytes, but got {})",
30471 Self::ENCODED_LEN,
30472 __tmp.remaining(),
30473 )
30474 }
30475 __tmp.put_u32_le(self.request_id);
30476 __tmp.put_u8(self.result as u8);
30477 if matches!(version, MavlinkVersion::V2) {
30478 let len = __tmp.len();
30479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30480 } else {
30481 __tmp.len()
30482 }
30483 }
30484}
30485#[doc = "id: 11035"]
30486#[doc = "Read a configured an OSD parameter slot."]
30487#[derive(Debug, Clone, PartialEq)]
30488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30490pub struct OSD_PARAM_SHOW_CONFIG_DATA {
30491 #[doc = "Request ID - copied to reply."]
30492 pub request_id: u32,
30493 #[doc = "System ID."]
30494 pub target_system: u8,
30495 #[doc = "Component ID."]
30496 pub target_component: u8,
30497 #[doc = "OSD parameter screen index."]
30498 pub osd_screen: u8,
30499 #[doc = "OSD parameter display index."]
30500 pub osd_index: u8,
30501}
30502impl OSD_PARAM_SHOW_CONFIG_DATA {
30503 pub const ENCODED_LEN: usize = 8usize;
30504 pub const DEFAULT: Self = Self {
30505 request_id: 0_u32,
30506 target_system: 0_u8,
30507 target_component: 0_u8,
30508 osd_screen: 0_u8,
30509 osd_index: 0_u8,
30510 };
30511 #[cfg(feature = "arbitrary")]
30512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30513 use arbitrary::{Arbitrary, Unstructured};
30514 let mut buf = [0u8; 1024];
30515 rng.fill_bytes(&mut buf);
30516 let mut unstructured = Unstructured::new(&buf);
30517 Self::arbitrary(&mut unstructured).unwrap_or_default()
30518 }
30519}
30520impl Default for OSD_PARAM_SHOW_CONFIG_DATA {
30521 fn default() -> Self {
30522 Self::DEFAULT.clone()
30523 }
30524}
30525impl MessageData for OSD_PARAM_SHOW_CONFIG_DATA {
30526 type Message = MavMessage;
30527 const ID: u32 = 11035u32;
30528 const NAME: &'static str = "OSD_PARAM_SHOW_CONFIG";
30529 const EXTRA_CRC: u8 = 128u8;
30530 const ENCODED_LEN: usize = 8usize;
30531 fn deser(
30532 _version: MavlinkVersion,
30533 __input: &[u8],
30534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30535 let avail_len = __input.len();
30536 let mut payload_buf = [0; Self::ENCODED_LEN];
30537 let mut buf = if avail_len < Self::ENCODED_LEN {
30538 payload_buf[0..avail_len].copy_from_slice(__input);
30539 Bytes::new(&payload_buf)
30540 } else {
30541 Bytes::new(__input)
30542 };
30543 let mut __struct = Self::default();
30544 __struct.request_id = buf.get_u32_le();
30545 __struct.target_system = buf.get_u8();
30546 __struct.target_component = buf.get_u8();
30547 __struct.osd_screen = buf.get_u8();
30548 __struct.osd_index = buf.get_u8();
30549 Ok(__struct)
30550 }
30551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30552 let mut __tmp = BytesMut::new(bytes);
30553 #[allow(clippy::absurd_extreme_comparisons)]
30554 #[allow(unused_comparisons)]
30555 if __tmp.remaining() < Self::ENCODED_LEN {
30556 panic!(
30557 "buffer is too small (need {} bytes, but got {})",
30558 Self::ENCODED_LEN,
30559 __tmp.remaining(),
30560 )
30561 }
30562 __tmp.put_u32_le(self.request_id);
30563 __tmp.put_u8(self.target_system);
30564 __tmp.put_u8(self.target_component);
30565 __tmp.put_u8(self.osd_screen);
30566 __tmp.put_u8(self.osd_index);
30567 if matches!(version, MavlinkVersion::V2) {
30568 let len = __tmp.len();
30569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30570 } else {
30571 __tmp.len()
30572 }
30573 }
30574}
30575#[doc = "id: 11036"]
30576#[doc = "Read configured OSD parameter reply."]
30577#[derive(Debug, Clone, PartialEq)]
30578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30580pub struct OSD_PARAM_SHOW_CONFIG_REPLY_DATA {
30581 #[doc = "Request ID - copied from request."]
30582 pub request_id: u32,
30583 #[doc = "OSD parameter minimum value."]
30584 pub min_value: f32,
30585 #[doc = "OSD parameter maximum value."]
30586 pub max_value: f32,
30587 #[doc = "OSD parameter increment."]
30588 pub increment: f32,
30589 #[doc = "Config error type."]
30590 pub result: OsdParamConfigError,
30591 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30593 pub param_id: [u8; 16],
30594 #[doc = "Config type."]
30595 pub config_type: OsdParamConfigType,
30596}
30597impl OSD_PARAM_SHOW_CONFIG_REPLY_DATA {
30598 pub const ENCODED_LEN: usize = 34usize;
30599 pub const DEFAULT: Self = Self {
30600 request_id: 0_u32,
30601 min_value: 0.0_f32,
30602 max_value: 0.0_f32,
30603 increment: 0.0_f32,
30604 result: OsdParamConfigError::DEFAULT,
30605 param_id: [0_u8; 16usize],
30606 config_type: OsdParamConfigType::DEFAULT,
30607 };
30608 #[cfg(feature = "arbitrary")]
30609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30610 use arbitrary::{Arbitrary, Unstructured};
30611 let mut buf = [0u8; 1024];
30612 rng.fill_bytes(&mut buf);
30613 let mut unstructured = Unstructured::new(&buf);
30614 Self::arbitrary(&mut unstructured).unwrap_or_default()
30615 }
30616}
30617impl Default for OSD_PARAM_SHOW_CONFIG_REPLY_DATA {
30618 fn default() -> Self {
30619 Self::DEFAULT.clone()
30620 }
30621}
30622impl MessageData for OSD_PARAM_SHOW_CONFIG_REPLY_DATA {
30623 type Message = MavMessage;
30624 const ID: u32 = 11036u32;
30625 const NAME: &'static str = "OSD_PARAM_SHOW_CONFIG_REPLY";
30626 const EXTRA_CRC: u8 = 177u8;
30627 const ENCODED_LEN: usize = 34usize;
30628 fn deser(
30629 _version: MavlinkVersion,
30630 __input: &[u8],
30631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30632 let avail_len = __input.len();
30633 let mut payload_buf = [0; Self::ENCODED_LEN];
30634 let mut buf = if avail_len < Self::ENCODED_LEN {
30635 payload_buf[0..avail_len].copy_from_slice(__input);
30636 Bytes::new(&payload_buf)
30637 } else {
30638 Bytes::new(__input)
30639 };
30640 let mut __struct = Self::default();
30641 __struct.request_id = buf.get_u32_le();
30642 __struct.min_value = buf.get_f32_le();
30643 __struct.max_value = buf.get_f32_le();
30644 __struct.increment = buf.get_f32_le();
30645 let tmp = buf.get_u8();
30646 __struct.result =
30647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30648 enum_type: "OsdParamConfigError",
30649 value: tmp as u32,
30650 })?;
30651 for v in &mut __struct.param_id {
30652 let val = buf.get_u8();
30653 *v = val;
30654 }
30655 let tmp = buf.get_u8();
30656 __struct.config_type =
30657 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30658 enum_type: "OsdParamConfigType",
30659 value: tmp as u32,
30660 })?;
30661 Ok(__struct)
30662 }
30663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30664 let mut __tmp = BytesMut::new(bytes);
30665 #[allow(clippy::absurd_extreme_comparisons)]
30666 #[allow(unused_comparisons)]
30667 if __tmp.remaining() < Self::ENCODED_LEN {
30668 panic!(
30669 "buffer is too small (need {} bytes, but got {})",
30670 Self::ENCODED_LEN,
30671 __tmp.remaining(),
30672 )
30673 }
30674 __tmp.put_u32_le(self.request_id);
30675 __tmp.put_f32_le(self.min_value);
30676 __tmp.put_f32_le(self.max_value);
30677 __tmp.put_f32_le(self.increment);
30678 __tmp.put_u8(self.result as u8);
30679 for val in &self.param_id {
30680 __tmp.put_u8(*val);
30681 }
30682 __tmp.put_u8(self.config_type as u8);
30683 if matches!(version, MavlinkVersion::V2) {
30684 let len = __tmp.len();
30685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30686 } else {
30687 __tmp.len()
30688 }
30689 }
30690}
30691#[doc = "id: 324"]
30692#[doc = "Response from a PARAM_EXT_SET message."]
30693#[derive(Debug, Clone, PartialEq)]
30694#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30696pub struct PARAM_EXT_ACK_DATA {
30697 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30699 pub param_id: [u8; 16],
30700 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
30701 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30702 pub param_value: [u8; 128],
30703 #[doc = "Parameter type."]
30704 pub param_type: MavParamExtType,
30705 #[doc = "Result code."]
30706 pub param_result: ParamAck,
30707}
30708impl PARAM_EXT_ACK_DATA {
30709 pub const ENCODED_LEN: usize = 146usize;
30710 pub const DEFAULT: Self = Self {
30711 param_id: [0_u8; 16usize],
30712 param_value: [0_u8; 128usize],
30713 param_type: MavParamExtType::DEFAULT,
30714 param_result: ParamAck::DEFAULT,
30715 };
30716 #[cfg(feature = "arbitrary")]
30717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30718 use arbitrary::{Arbitrary, Unstructured};
30719 let mut buf = [0u8; 1024];
30720 rng.fill_bytes(&mut buf);
30721 let mut unstructured = Unstructured::new(&buf);
30722 Self::arbitrary(&mut unstructured).unwrap_or_default()
30723 }
30724}
30725impl Default for PARAM_EXT_ACK_DATA {
30726 fn default() -> Self {
30727 Self::DEFAULT.clone()
30728 }
30729}
30730impl MessageData for PARAM_EXT_ACK_DATA {
30731 type Message = MavMessage;
30732 const ID: u32 = 324u32;
30733 const NAME: &'static str = "PARAM_EXT_ACK";
30734 const EXTRA_CRC: u8 = 132u8;
30735 const ENCODED_LEN: usize = 146usize;
30736 fn deser(
30737 _version: MavlinkVersion,
30738 __input: &[u8],
30739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30740 let avail_len = __input.len();
30741 let mut payload_buf = [0; Self::ENCODED_LEN];
30742 let mut buf = if avail_len < Self::ENCODED_LEN {
30743 payload_buf[0..avail_len].copy_from_slice(__input);
30744 Bytes::new(&payload_buf)
30745 } else {
30746 Bytes::new(__input)
30747 };
30748 let mut __struct = Self::default();
30749 for v in &mut __struct.param_id {
30750 let val = buf.get_u8();
30751 *v = val;
30752 }
30753 for v in &mut __struct.param_value {
30754 let val = buf.get_u8();
30755 *v = val;
30756 }
30757 let tmp = buf.get_u8();
30758 __struct.param_type =
30759 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30760 enum_type: "MavParamExtType",
30761 value: tmp as u32,
30762 })?;
30763 let tmp = buf.get_u8();
30764 __struct.param_result =
30765 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30766 enum_type: "ParamAck",
30767 value: tmp as u32,
30768 })?;
30769 Ok(__struct)
30770 }
30771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30772 let mut __tmp = BytesMut::new(bytes);
30773 #[allow(clippy::absurd_extreme_comparisons)]
30774 #[allow(unused_comparisons)]
30775 if __tmp.remaining() < Self::ENCODED_LEN {
30776 panic!(
30777 "buffer is too small (need {} bytes, but got {})",
30778 Self::ENCODED_LEN,
30779 __tmp.remaining(),
30780 )
30781 }
30782 for val in &self.param_id {
30783 __tmp.put_u8(*val);
30784 }
30785 for val in &self.param_value {
30786 __tmp.put_u8(*val);
30787 }
30788 __tmp.put_u8(self.param_type as u8);
30789 __tmp.put_u8(self.param_result as u8);
30790 if matches!(version, MavlinkVersion::V2) {
30791 let len = __tmp.len();
30792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30793 } else {
30794 __tmp.len()
30795 }
30796 }
30797}
30798#[doc = "id: 321"]
30799#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
30800#[derive(Debug, Clone, PartialEq)]
30801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30803pub struct PARAM_EXT_REQUEST_LIST_DATA {
30804 #[doc = "System ID"]
30805 pub target_system: u8,
30806 #[doc = "Component ID"]
30807 pub target_component: u8,
30808}
30809impl PARAM_EXT_REQUEST_LIST_DATA {
30810 pub const ENCODED_LEN: usize = 2usize;
30811 pub const DEFAULT: Self = Self {
30812 target_system: 0_u8,
30813 target_component: 0_u8,
30814 };
30815 #[cfg(feature = "arbitrary")]
30816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30817 use arbitrary::{Arbitrary, Unstructured};
30818 let mut buf = [0u8; 1024];
30819 rng.fill_bytes(&mut buf);
30820 let mut unstructured = Unstructured::new(&buf);
30821 Self::arbitrary(&mut unstructured).unwrap_or_default()
30822 }
30823}
30824impl Default for PARAM_EXT_REQUEST_LIST_DATA {
30825 fn default() -> Self {
30826 Self::DEFAULT.clone()
30827 }
30828}
30829impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
30830 type Message = MavMessage;
30831 const ID: u32 = 321u32;
30832 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
30833 const EXTRA_CRC: u8 = 88u8;
30834 const ENCODED_LEN: usize = 2usize;
30835 fn deser(
30836 _version: MavlinkVersion,
30837 __input: &[u8],
30838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30839 let avail_len = __input.len();
30840 let mut payload_buf = [0; Self::ENCODED_LEN];
30841 let mut buf = if avail_len < Self::ENCODED_LEN {
30842 payload_buf[0..avail_len].copy_from_slice(__input);
30843 Bytes::new(&payload_buf)
30844 } else {
30845 Bytes::new(__input)
30846 };
30847 let mut __struct = Self::default();
30848 __struct.target_system = buf.get_u8();
30849 __struct.target_component = buf.get_u8();
30850 Ok(__struct)
30851 }
30852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30853 let mut __tmp = BytesMut::new(bytes);
30854 #[allow(clippy::absurd_extreme_comparisons)]
30855 #[allow(unused_comparisons)]
30856 if __tmp.remaining() < Self::ENCODED_LEN {
30857 panic!(
30858 "buffer is too small (need {} bytes, but got {})",
30859 Self::ENCODED_LEN,
30860 __tmp.remaining(),
30861 )
30862 }
30863 __tmp.put_u8(self.target_system);
30864 __tmp.put_u8(self.target_component);
30865 if matches!(version, MavlinkVersion::V2) {
30866 let len = __tmp.len();
30867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30868 } else {
30869 __tmp.len()
30870 }
30871 }
30872}
30873#[doc = "id: 320"]
30874#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
30875#[derive(Debug, Clone, PartialEq)]
30876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30878pub struct PARAM_EXT_REQUEST_READ_DATA {
30879 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
30880 pub param_index: i16,
30881 #[doc = "System ID"]
30882 pub target_system: u8,
30883 #[doc = "Component ID"]
30884 pub target_component: u8,
30885 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30886 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30887 pub param_id: [u8; 16],
30888}
30889impl PARAM_EXT_REQUEST_READ_DATA {
30890 pub const ENCODED_LEN: usize = 20usize;
30891 pub const DEFAULT: Self = Self {
30892 param_index: 0_i16,
30893 target_system: 0_u8,
30894 target_component: 0_u8,
30895 param_id: [0_u8; 16usize],
30896 };
30897 #[cfg(feature = "arbitrary")]
30898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30899 use arbitrary::{Arbitrary, Unstructured};
30900 let mut buf = [0u8; 1024];
30901 rng.fill_bytes(&mut buf);
30902 let mut unstructured = Unstructured::new(&buf);
30903 Self::arbitrary(&mut unstructured).unwrap_or_default()
30904 }
30905}
30906impl Default for PARAM_EXT_REQUEST_READ_DATA {
30907 fn default() -> Self {
30908 Self::DEFAULT.clone()
30909 }
30910}
30911impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
30912 type Message = MavMessage;
30913 const ID: u32 = 320u32;
30914 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
30915 const EXTRA_CRC: u8 = 243u8;
30916 const ENCODED_LEN: usize = 20usize;
30917 fn deser(
30918 _version: MavlinkVersion,
30919 __input: &[u8],
30920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30921 let avail_len = __input.len();
30922 let mut payload_buf = [0; Self::ENCODED_LEN];
30923 let mut buf = if avail_len < Self::ENCODED_LEN {
30924 payload_buf[0..avail_len].copy_from_slice(__input);
30925 Bytes::new(&payload_buf)
30926 } else {
30927 Bytes::new(__input)
30928 };
30929 let mut __struct = Self::default();
30930 __struct.param_index = buf.get_i16_le();
30931 __struct.target_system = buf.get_u8();
30932 __struct.target_component = buf.get_u8();
30933 for v in &mut __struct.param_id {
30934 let val = buf.get_u8();
30935 *v = val;
30936 }
30937 Ok(__struct)
30938 }
30939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30940 let mut __tmp = BytesMut::new(bytes);
30941 #[allow(clippy::absurd_extreme_comparisons)]
30942 #[allow(unused_comparisons)]
30943 if __tmp.remaining() < Self::ENCODED_LEN {
30944 panic!(
30945 "buffer is too small (need {} bytes, but got {})",
30946 Self::ENCODED_LEN,
30947 __tmp.remaining(),
30948 )
30949 }
30950 __tmp.put_i16_le(self.param_index);
30951 __tmp.put_u8(self.target_system);
30952 __tmp.put_u8(self.target_component);
30953 for val in &self.param_id {
30954 __tmp.put_u8(*val);
30955 }
30956 if matches!(version, MavlinkVersion::V2) {
30957 let len = __tmp.len();
30958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30959 } else {
30960 __tmp.len()
30961 }
30962 }
30963}
30964#[doc = "id: 323"]
30965#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
30966#[derive(Debug, Clone, PartialEq)]
30967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30969pub struct PARAM_EXT_SET_DATA {
30970 #[doc = "System ID"]
30971 pub target_system: u8,
30972 #[doc = "Component ID"]
30973 pub target_component: u8,
30974 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30976 pub param_id: [u8; 16],
30977 #[doc = "Parameter value"]
30978 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30979 pub param_value: [u8; 128],
30980 #[doc = "Parameter type."]
30981 pub param_type: MavParamExtType,
30982}
30983impl PARAM_EXT_SET_DATA {
30984 pub const ENCODED_LEN: usize = 147usize;
30985 pub const DEFAULT: Self = Self {
30986 target_system: 0_u8,
30987 target_component: 0_u8,
30988 param_id: [0_u8; 16usize],
30989 param_value: [0_u8; 128usize],
30990 param_type: MavParamExtType::DEFAULT,
30991 };
30992 #[cfg(feature = "arbitrary")]
30993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30994 use arbitrary::{Arbitrary, Unstructured};
30995 let mut buf = [0u8; 1024];
30996 rng.fill_bytes(&mut buf);
30997 let mut unstructured = Unstructured::new(&buf);
30998 Self::arbitrary(&mut unstructured).unwrap_or_default()
30999 }
31000}
31001impl Default for PARAM_EXT_SET_DATA {
31002 fn default() -> Self {
31003 Self::DEFAULT.clone()
31004 }
31005}
31006impl MessageData for PARAM_EXT_SET_DATA {
31007 type Message = MavMessage;
31008 const ID: u32 = 323u32;
31009 const NAME: &'static str = "PARAM_EXT_SET";
31010 const EXTRA_CRC: u8 = 78u8;
31011 const ENCODED_LEN: usize = 147usize;
31012 fn deser(
31013 _version: MavlinkVersion,
31014 __input: &[u8],
31015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31016 let avail_len = __input.len();
31017 let mut payload_buf = [0; Self::ENCODED_LEN];
31018 let mut buf = if avail_len < Self::ENCODED_LEN {
31019 payload_buf[0..avail_len].copy_from_slice(__input);
31020 Bytes::new(&payload_buf)
31021 } else {
31022 Bytes::new(__input)
31023 };
31024 let mut __struct = Self::default();
31025 __struct.target_system = buf.get_u8();
31026 __struct.target_component = buf.get_u8();
31027 for v in &mut __struct.param_id {
31028 let val = buf.get_u8();
31029 *v = val;
31030 }
31031 for v in &mut __struct.param_value {
31032 let val = buf.get_u8();
31033 *v = val;
31034 }
31035 let tmp = buf.get_u8();
31036 __struct.param_type =
31037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31038 enum_type: "MavParamExtType",
31039 value: tmp as u32,
31040 })?;
31041 Ok(__struct)
31042 }
31043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31044 let mut __tmp = BytesMut::new(bytes);
31045 #[allow(clippy::absurd_extreme_comparisons)]
31046 #[allow(unused_comparisons)]
31047 if __tmp.remaining() < Self::ENCODED_LEN {
31048 panic!(
31049 "buffer is too small (need {} bytes, but got {})",
31050 Self::ENCODED_LEN,
31051 __tmp.remaining(),
31052 )
31053 }
31054 __tmp.put_u8(self.target_system);
31055 __tmp.put_u8(self.target_component);
31056 for val in &self.param_id {
31057 __tmp.put_u8(*val);
31058 }
31059 for val in &self.param_value {
31060 __tmp.put_u8(*val);
31061 }
31062 __tmp.put_u8(self.param_type as u8);
31063 if matches!(version, MavlinkVersion::V2) {
31064 let len = __tmp.len();
31065 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31066 } else {
31067 __tmp.len()
31068 }
31069 }
31070}
31071#[doc = "id: 322"]
31072#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
31073#[derive(Debug, Clone, PartialEq)]
31074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31076pub struct PARAM_EXT_VALUE_DATA {
31077 #[doc = "Total number of parameters"]
31078 pub param_count: u16,
31079 #[doc = "Index of this parameter"]
31080 pub param_index: u16,
31081 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
31082 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31083 pub param_id: [u8; 16],
31084 #[doc = "Parameter value"]
31085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31086 pub param_value: [u8; 128],
31087 #[doc = "Parameter type."]
31088 pub param_type: MavParamExtType,
31089}
31090impl PARAM_EXT_VALUE_DATA {
31091 pub const ENCODED_LEN: usize = 149usize;
31092 pub const DEFAULT: Self = Self {
31093 param_count: 0_u16,
31094 param_index: 0_u16,
31095 param_id: [0_u8; 16usize],
31096 param_value: [0_u8; 128usize],
31097 param_type: MavParamExtType::DEFAULT,
31098 };
31099 #[cfg(feature = "arbitrary")]
31100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31101 use arbitrary::{Arbitrary, Unstructured};
31102 let mut buf = [0u8; 1024];
31103 rng.fill_bytes(&mut buf);
31104 let mut unstructured = Unstructured::new(&buf);
31105 Self::arbitrary(&mut unstructured).unwrap_or_default()
31106 }
31107}
31108impl Default for PARAM_EXT_VALUE_DATA {
31109 fn default() -> Self {
31110 Self::DEFAULT.clone()
31111 }
31112}
31113impl MessageData for PARAM_EXT_VALUE_DATA {
31114 type Message = MavMessage;
31115 const ID: u32 = 322u32;
31116 const NAME: &'static str = "PARAM_EXT_VALUE";
31117 const EXTRA_CRC: u8 = 243u8;
31118 const ENCODED_LEN: usize = 149usize;
31119 fn deser(
31120 _version: MavlinkVersion,
31121 __input: &[u8],
31122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31123 let avail_len = __input.len();
31124 let mut payload_buf = [0; Self::ENCODED_LEN];
31125 let mut buf = if avail_len < Self::ENCODED_LEN {
31126 payload_buf[0..avail_len].copy_from_slice(__input);
31127 Bytes::new(&payload_buf)
31128 } else {
31129 Bytes::new(__input)
31130 };
31131 let mut __struct = Self::default();
31132 __struct.param_count = buf.get_u16_le();
31133 __struct.param_index = buf.get_u16_le();
31134 for v in &mut __struct.param_id {
31135 let val = buf.get_u8();
31136 *v = val;
31137 }
31138 for v in &mut __struct.param_value {
31139 let val = buf.get_u8();
31140 *v = val;
31141 }
31142 let tmp = buf.get_u8();
31143 __struct.param_type =
31144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31145 enum_type: "MavParamExtType",
31146 value: tmp as u32,
31147 })?;
31148 Ok(__struct)
31149 }
31150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31151 let mut __tmp = BytesMut::new(bytes);
31152 #[allow(clippy::absurd_extreme_comparisons)]
31153 #[allow(unused_comparisons)]
31154 if __tmp.remaining() < Self::ENCODED_LEN {
31155 panic!(
31156 "buffer is too small (need {} bytes, but got {})",
31157 Self::ENCODED_LEN,
31158 __tmp.remaining(),
31159 )
31160 }
31161 __tmp.put_u16_le(self.param_count);
31162 __tmp.put_u16_le(self.param_index);
31163 for val in &self.param_id {
31164 __tmp.put_u8(*val);
31165 }
31166 for val in &self.param_value {
31167 __tmp.put_u8(*val);
31168 }
31169 __tmp.put_u8(self.param_type as u8);
31170 if matches!(version, MavlinkVersion::V2) {
31171 let len = __tmp.len();
31172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31173 } else {
31174 __tmp.len()
31175 }
31176 }
31177}
31178#[doc = "id: 50"]
31179#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
31180#[derive(Debug, Clone, PartialEq)]
31181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31183pub struct PARAM_MAP_RC_DATA {
31184 #[doc = "Initial parameter value"]
31185 pub param_value0: f32,
31186 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
31187 pub scale: f32,
31188 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
31189 pub param_value_min: f32,
31190 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
31191 pub param_value_max: f32,
31192 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
31193 pub param_index: i16,
31194 #[doc = "System ID"]
31195 pub target_system: u8,
31196 #[doc = "Component ID"]
31197 pub target_component: u8,
31198 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
31199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31200 pub param_id: [u8; 16],
31201 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
31202 pub parameter_rc_channel_index: u8,
31203}
31204impl PARAM_MAP_RC_DATA {
31205 pub const ENCODED_LEN: usize = 37usize;
31206 pub const DEFAULT: Self = Self {
31207 param_value0: 0.0_f32,
31208 scale: 0.0_f32,
31209 param_value_min: 0.0_f32,
31210 param_value_max: 0.0_f32,
31211 param_index: 0_i16,
31212 target_system: 0_u8,
31213 target_component: 0_u8,
31214 param_id: [0_u8; 16usize],
31215 parameter_rc_channel_index: 0_u8,
31216 };
31217 #[cfg(feature = "arbitrary")]
31218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31219 use arbitrary::{Arbitrary, Unstructured};
31220 let mut buf = [0u8; 1024];
31221 rng.fill_bytes(&mut buf);
31222 let mut unstructured = Unstructured::new(&buf);
31223 Self::arbitrary(&mut unstructured).unwrap_or_default()
31224 }
31225}
31226impl Default for PARAM_MAP_RC_DATA {
31227 fn default() -> Self {
31228 Self::DEFAULT.clone()
31229 }
31230}
31231impl MessageData for PARAM_MAP_RC_DATA {
31232 type Message = MavMessage;
31233 const ID: u32 = 50u32;
31234 const NAME: &'static str = "PARAM_MAP_RC";
31235 const EXTRA_CRC: u8 = 78u8;
31236 const ENCODED_LEN: usize = 37usize;
31237 fn deser(
31238 _version: MavlinkVersion,
31239 __input: &[u8],
31240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31241 let avail_len = __input.len();
31242 let mut payload_buf = [0; Self::ENCODED_LEN];
31243 let mut buf = if avail_len < Self::ENCODED_LEN {
31244 payload_buf[0..avail_len].copy_from_slice(__input);
31245 Bytes::new(&payload_buf)
31246 } else {
31247 Bytes::new(__input)
31248 };
31249 let mut __struct = Self::default();
31250 __struct.param_value0 = buf.get_f32_le();
31251 __struct.scale = buf.get_f32_le();
31252 __struct.param_value_min = buf.get_f32_le();
31253 __struct.param_value_max = buf.get_f32_le();
31254 __struct.param_index = buf.get_i16_le();
31255 __struct.target_system = buf.get_u8();
31256 __struct.target_component = buf.get_u8();
31257 for v in &mut __struct.param_id {
31258 let val = buf.get_u8();
31259 *v = val;
31260 }
31261 __struct.parameter_rc_channel_index = buf.get_u8();
31262 Ok(__struct)
31263 }
31264 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31265 let mut __tmp = BytesMut::new(bytes);
31266 #[allow(clippy::absurd_extreme_comparisons)]
31267 #[allow(unused_comparisons)]
31268 if __tmp.remaining() < Self::ENCODED_LEN {
31269 panic!(
31270 "buffer is too small (need {} bytes, but got {})",
31271 Self::ENCODED_LEN,
31272 __tmp.remaining(),
31273 )
31274 }
31275 __tmp.put_f32_le(self.param_value0);
31276 __tmp.put_f32_le(self.scale);
31277 __tmp.put_f32_le(self.param_value_min);
31278 __tmp.put_f32_le(self.param_value_max);
31279 __tmp.put_i16_le(self.param_index);
31280 __tmp.put_u8(self.target_system);
31281 __tmp.put_u8(self.target_component);
31282 for val in &self.param_id {
31283 __tmp.put_u8(*val);
31284 }
31285 __tmp.put_u8(self.parameter_rc_channel_index);
31286 if matches!(version, MavlinkVersion::V2) {
31287 let len = __tmp.len();
31288 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31289 } else {
31290 __tmp.len()
31291 }
31292 }
31293}
31294#[doc = "id: 21"]
31295#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31296#[derive(Debug, Clone, PartialEq)]
31297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31299pub struct PARAM_REQUEST_LIST_DATA {
31300 #[doc = "System ID"]
31301 pub target_system: u8,
31302 #[doc = "Component ID"]
31303 pub target_component: u8,
31304}
31305impl PARAM_REQUEST_LIST_DATA {
31306 pub const ENCODED_LEN: usize = 2usize;
31307 pub const DEFAULT: Self = Self {
31308 target_system: 0_u8,
31309 target_component: 0_u8,
31310 };
31311 #[cfg(feature = "arbitrary")]
31312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31313 use arbitrary::{Arbitrary, Unstructured};
31314 let mut buf = [0u8; 1024];
31315 rng.fill_bytes(&mut buf);
31316 let mut unstructured = Unstructured::new(&buf);
31317 Self::arbitrary(&mut unstructured).unwrap_or_default()
31318 }
31319}
31320impl Default for PARAM_REQUEST_LIST_DATA {
31321 fn default() -> Self {
31322 Self::DEFAULT.clone()
31323 }
31324}
31325impl MessageData for PARAM_REQUEST_LIST_DATA {
31326 type Message = MavMessage;
31327 const ID: u32 = 21u32;
31328 const NAME: &'static str = "PARAM_REQUEST_LIST";
31329 const EXTRA_CRC: u8 = 159u8;
31330 const ENCODED_LEN: usize = 2usize;
31331 fn deser(
31332 _version: MavlinkVersion,
31333 __input: &[u8],
31334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31335 let avail_len = __input.len();
31336 let mut payload_buf = [0; Self::ENCODED_LEN];
31337 let mut buf = if avail_len < Self::ENCODED_LEN {
31338 payload_buf[0..avail_len].copy_from_slice(__input);
31339 Bytes::new(&payload_buf)
31340 } else {
31341 Bytes::new(__input)
31342 };
31343 let mut __struct = Self::default();
31344 __struct.target_system = buf.get_u8();
31345 __struct.target_component = buf.get_u8();
31346 Ok(__struct)
31347 }
31348 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31349 let mut __tmp = BytesMut::new(bytes);
31350 #[allow(clippy::absurd_extreme_comparisons)]
31351 #[allow(unused_comparisons)]
31352 if __tmp.remaining() < Self::ENCODED_LEN {
31353 panic!(
31354 "buffer is too small (need {} bytes, but got {})",
31355 Self::ENCODED_LEN,
31356 __tmp.remaining(),
31357 )
31358 }
31359 __tmp.put_u8(self.target_system);
31360 __tmp.put_u8(self.target_component);
31361 if matches!(version, MavlinkVersion::V2) {
31362 let len = __tmp.len();
31363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31364 } else {
31365 __tmp.len()
31366 }
31367 }
31368}
31369#[doc = "id: 20"]
31370#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
31371#[derive(Debug, Clone, PartialEq)]
31372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31374pub struct PARAM_REQUEST_READ_DATA {
31375 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
31376 pub param_index: i16,
31377 #[doc = "System ID"]
31378 pub target_system: u8,
31379 #[doc = "Component ID"]
31380 pub target_component: u8,
31381 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
31382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31383 pub param_id: [u8; 16],
31384}
31385impl PARAM_REQUEST_READ_DATA {
31386 pub const ENCODED_LEN: usize = 20usize;
31387 pub const DEFAULT: Self = Self {
31388 param_index: 0_i16,
31389 target_system: 0_u8,
31390 target_component: 0_u8,
31391 param_id: [0_u8; 16usize],
31392 };
31393 #[cfg(feature = "arbitrary")]
31394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31395 use arbitrary::{Arbitrary, Unstructured};
31396 let mut buf = [0u8; 1024];
31397 rng.fill_bytes(&mut buf);
31398 let mut unstructured = Unstructured::new(&buf);
31399 Self::arbitrary(&mut unstructured).unwrap_or_default()
31400 }
31401}
31402impl Default for PARAM_REQUEST_READ_DATA {
31403 fn default() -> Self {
31404 Self::DEFAULT.clone()
31405 }
31406}
31407impl MessageData for PARAM_REQUEST_READ_DATA {
31408 type Message = MavMessage;
31409 const ID: u32 = 20u32;
31410 const NAME: &'static str = "PARAM_REQUEST_READ";
31411 const EXTRA_CRC: u8 = 214u8;
31412 const ENCODED_LEN: usize = 20usize;
31413 fn deser(
31414 _version: MavlinkVersion,
31415 __input: &[u8],
31416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31417 let avail_len = __input.len();
31418 let mut payload_buf = [0; Self::ENCODED_LEN];
31419 let mut buf = if avail_len < Self::ENCODED_LEN {
31420 payload_buf[0..avail_len].copy_from_slice(__input);
31421 Bytes::new(&payload_buf)
31422 } else {
31423 Bytes::new(__input)
31424 };
31425 let mut __struct = Self::default();
31426 __struct.param_index = buf.get_i16_le();
31427 __struct.target_system = buf.get_u8();
31428 __struct.target_component = buf.get_u8();
31429 for v in &mut __struct.param_id {
31430 let val = buf.get_u8();
31431 *v = val;
31432 }
31433 Ok(__struct)
31434 }
31435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31436 let mut __tmp = BytesMut::new(bytes);
31437 #[allow(clippy::absurd_extreme_comparisons)]
31438 #[allow(unused_comparisons)]
31439 if __tmp.remaining() < Self::ENCODED_LEN {
31440 panic!(
31441 "buffer is too small (need {} bytes, but got {})",
31442 Self::ENCODED_LEN,
31443 __tmp.remaining(),
31444 )
31445 }
31446 __tmp.put_i16_le(self.param_index);
31447 __tmp.put_u8(self.target_system);
31448 __tmp.put_u8(self.target_component);
31449 for val in &self.param_id {
31450 __tmp.put_u8(*val);
31451 }
31452 if matches!(version, MavlinkVersion::V2) {
31453 let len = __tmp.len();
31454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31455 } else {
31456 __tmp.len()
31457 }
31458 }
31459}
31460#[doc = "id: 23"]
31461#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31462#[derive(Debug, Clone, PartialEq)]
31463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31465pub struct PARAM_SET_DATA {
31466 #[doc = "Onboard parameter value"]
31467 pub param_value: f32,
31468 #[doc = "System ID"]
31469 pub target_system: u8,
31470 #[doc = "Component ID"]
31471 pub target_component: u8,
31472 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
31473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31474 pub param_id: [u8; 16],
31475 #[doc = "Onboard parameter type."]
31476 pub param_type: MavParamType,
31477}
31478impl PARAM_SET_DATA {
31479 pub const ENCODED_LEN: usize = 23usize;
31480 pub const DEFAULT: Self = Self {
31481 param_value: 0.0_f32,
31482 target_system: 0_u8,
31483 target_component: 0_u8,
31484 param_id: [0_u8; 16usize],
31485 param_type: MavParamType::DEFAULT,
31486 };
31487 #[cfg(feature = "arbitrary")]
31488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31489 use arbitrary::{Arbitrary, Unstructured};
31490 let mut buf = [0u8; 1024];
31491 rng.fill_bytes(&mut buf);
31492 let mut unstructured = Unstructured::new(&buf);
31493 Self::arbitrary(&mut unstructured).unwrap_or_default()
31494 }
31495}
31496impl Default for PARAM_SET_DATA {
31497 fn default() -> Self {
31498 Self::DEFAULT.clone()
31499 }
31500}
31501impl MessageData for PARAM_SET_DATA {
31502 type Message = MavMessage;
31503 const ID: u32 = 23u32;
31504 const NAME: &'static str = "PARAM_SET";
31505 const EXTRA_CRC: u8 = 168u8;
31506 const ENCODED_LEN: usize = 23usize;
31507 fn deser(
31508 _version: MavlinkVersion,
31509 __input: &[u8],
31510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31511 let avail_len = __input.len();
31512 let mut payload_buf = [0; Self::ENCODED_LEN];
31513 let mut buf = if avail_len < Self::ENCODED_LEN {
31514 payload_buf[0..avail_len].copy_from_slice(__input);
31515 Bytes::new(&payload_buf)
31516 } else {
31517 Bytes::new(__input)
31518 };
31519 let mut __struct = Self::default();
31520 __struct.param_value = buf.get_f32_le();
31521 __struct.target_system = buf.get_u8();
31522 __struct.target_component = buf.get_u8();
31523 for v in &mut __struct.param_id {
31524 let val = buf.get_u8();
31525 *v = val;
31526 }
31527 let tmp = buf.get_u8();
31528 __struct.param_type =
31529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31530 enum_type: "MavParamType",
31531 value: tmp as u32,
31532 })?;
31533 Ok(__struct)
31534 }
31535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31536 let mut __tmp = BytesMut::new(bytes);
31537 #[allow(clippy::absurd_extreme_comparisons)]
31538 #[allow(unused_comparisons)]
31539 if __tmp.remaining() < Self::ENCODED_LEN {
31540 panic!(
31541 "buffer is too small (need {} bytes, but got {})",
31542 Self::ENCODED_LEN,
31543 __tmp.remaining(),
31544 )
31545 }
31546 __tmp.put_f32_le(self.param_value);
31547 __tmp.put_u8(self.target_system);
31548 __tmp.put_u8(self.target_component);
31549 for val in &self.param_id {
31550 __tmp.put_u8(*val);
31551 }
31552 __tmp.put_u8(self.param_type as u8);
31553 if matches!(version, MavlinkVersion::V2) {
31554 let len = __tmp.len();
31555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31556 } else {
31557 __tmp.len()
31558 }
31559 }
31560}
31561#[doc = "id: 22"]
31562#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31563#[derive(Debug, Clone, PartialEq)]
31564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31566pub struct PARAM_VALUE_DATA {
31567 #[doc = "Onboard parameter value"]
31568 pub param_value: f32,
31569 #[doc = "Total number of onboard parameters"]
31570 pub param_count: u16,
31571 #[doc = "Index of this onboard parameter"]
31572 pub param_index: u16,
31573 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
31574 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31575 pub param_id: [u8; 16],
31576 #[doc = "Onboard parameter type."]
31577 pub param_type: MavParamType,
31578}
31579impl PARAM_VALUE_DATA {
31580 pub const ENCODED_LEN: usize = 25usize;
31581 pub const DEFAULT: Self = Self {
31582 param_value: 0.0_f32,
31583 param_count: 0_u16,
31584 param_index: 0_u16,
31585 param_id: [0_u8; 16usize],
31586 param_type: MavParamType::DEFAULT,
31587 };
31588 #[cfg(feature = "arbitrary")]
31589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31590 use arbitrary::{Arbitrary, Unstructured};
31591 let mut buf = [0u8; 1024];
31592 rng.fill_bytes(&mut buf);
31593 let mut unstructured = Unstructured::new(&buf);
31594 Self::arbitrary(&mut unstructured).unwrap_or_default()
31595 }
31596}
31597impl Default for PARAM_VALUE_DATA {
31598 fn default() -> Self {
31599 Self::DEFAULT.clone()
31600 }
31601}
31602impl MessageData for PARAM_VALUE_DATA {
31603 type Message = MavMessage;
31604 const ID: u32 = 22u32;
31605 const NAME: &'static str = "PARAM_VALUE";
31606 const EXTRA_CRC: u8 = 220u8;
31607 const ENCODED_LEN: usize = 25usize;
31608 fn deser(
31609 _version: MavlinkVersion,
31610 __input: &[u8],
31611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31612 let avail_len = __input.len();
31613 let mut payload_buf = [0; Self::ENCODED_LEN];
31614 let mut buf = if avail_len < Self::ENCODED_LEN {
31615 payload_buf[0..avail_len].copy_from_slice(__input);
31616 Bytes::new(&payload_buf)
31617 } else {
31618 Bytes::new(__input)
31619 };
31620 let mut __struct = Self::default();
31621 __struct.param_value = buf.get_f32_le();
31622 __struct.param_count = buf.get_u16_le();
31623 __struct.param_index = buf.get_u16_le();
31624 for v in &mut __struct.param_id {
31625 let val = buf.get_u8();
31626 *v = val;
31627 }
31628 let tmp = buf.get_u8();
31629 __struct.param_type =
31630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31631 enum_type: "MavParamType",
31632 value: tmp as u32,
31633 })?;
31634 Ok(__struct)
31635 }
31636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31637 let mut __tmp = BytesMut::new(bytes);
31638 #[allow(clippy::absurd_extreme_comparisons)]
31639 #[allow(unused_comparisons)]
31640 if __tmp.remaining() < Self::ENCODED_LEN {
31641 panic!(
31642 "buffer is too small (need {} bytes, but got {})",
31643 Self::ENCODED_LEN,
31644 __tmp.remaining(),
31645 )
31646 }
31647 __tmp.put_f32_le(self.param_value);
31648 __tmp.put_u16_le(self.param_count);
31649 __tmp.put_u16_le(self.param_index);
31650 for val in &self.param_id {
31651 __tmp.put_u8(*val);
31652 }
31653 __tmp.put_u8(self.param_type as u8);
31654 if matches!(version, MavlinkVersion::V2) {
31655 let len = __tmp.len();
31656 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31657 } else {
31658 __tmp.len()
31659 }
31660 }
31661}
31662#[doc = "id: 194"]
31663#[doc = "PID tuning information."]
31664#[derive(Debug, Clone, PartialEq)]
31665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31667pub struct PID_TUNING_DATA {
31668 #[doc = "Desired rate."]
31669 pub desired: f32,
31670 #[doc = "Achieved rate."]
31671 pub achieved: f32,
31672 #[doc = "FF component."]
31673 pub FF: f32,
31674 #[doc = "P component."]
31675 pub P: f32,
31676 #[doc = "I component."]
31677 pub I: f32,
31678 #[doc = "D component."]
31679 pub D: f32,
31680 #[doc = "Axis."]
31681 pub axis: PidTuningAxis,
31682 #[doc = "Slew rate."]
31683 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31684 pub SRate: f32,
31685 #[doc = "P/D oscillation modifier."]
31686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31687 pub PDmod: f32,
31688}
31689impl PID_TUNING_DATA {
31690 pub const ENCODED_LEN: usize = 33usize;
31691 pub const DEFAULT: Self = Self {
31692 desired: 0.0_f32,
31693 achieved: 0.0_f32,
31694 FF: 0.0_f32,
31695 P: 0.0_f32,
31696 I: 0.0_f32,
31697 D: 0.0_f32,
31698 axis: PidTuningAxis::DEFAULT,
31699 SRate: 0.0_f32,
31700 PDmod: 0.0_f32,
31701 };
31702 #[cfg(feature = "arbitrary")]
31703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31704 use arbitrary::{Arbitrary, Unstructured};
31705 let mut buf = [0u8; 1024];
31706 rng.fill_bytes(&mut buf);
31707 let mut unstructured = Unstructured::new(&buf);
31708 Self::arbitrary(&mut unstructured).unwrap_or_default()
31709 }
31710}
31711impl Default for PID_TUNING_DATA {
31712 fn default() -> Self {
31713 Self::DEFAULT.clone()
31714 }
31715}
31716impl MessageData for PID_TUNING_DATA {
31717 type Message = MavMessage;
31718 const ID: u32 = 194u32;
31719 const NAME: &'static str = "PID_TUNING";
31720 const EXTRA_CRC: u8 = 98u8;
31721 const ENCODED_LEN: usize = 33usize;
31722 fn deser(
31723 _version: MavlinkVersion,
31724 __input: &[u8],
31725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31726 let avail_len = __input.len();
31727 let mut payload_buf = [0; Self::ENCODED_LEN];
31728 let mut buf = if avail_len < Self::ENCODED_LEN {
31729 payload_buf[0..avail_len].copy_from_slice(__input);
31730 Bytes::new(&payload_buf)
31731 } else {
31732 Bytes::new(__input)
31733 };
31734 let mut __struct = Self::default();
31735 __struct.desired = buf.get_f32_le();
31736 __struct.achieved = buf.get_f32_le();
31737 __struct.FF = buf.get_f32_le();
31738 __struct.P = buf.get_f32_le();
31739 __struct.I = buf.get_f32_le();
31740 __struct.D = buf.get_f32_le();
31741 let tmp = buf.get_u8();
31742 __struct.axis =
31743 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31744 enum_type: "PidTuningAxis",
31745 value: tmp as u32,
31746 })?;
31747 __struct.SRate = buf.get_f32_le();
31748 __struct.PDmod = buf.get_f32_le();
31749 Ok(__struct)
31750 }
31751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31752 let mut __tmp = BytesMut::new(bytes);
31753 #[allow(clippy::absurd_extreme_comparisons)]
31754 #[allow(unused_comparisons)]
31755 if __tmp.remaining() < Self::ENCODED_LEN {
31756 panic!(
31757 "buffer is too small (need {} bytes, but got {})",
31758 Self::ENCODED_LEN,
31759 __tmp.remaining(),
31760 )
31761 }
31762 __tmp.put_f32_le(self.desired);
31763 __tmp.put_f32_le(self.achieved);
31764 __tmp.put_f32_le(self.FF);
31765 __tmp.put_f32_le(self.P);
31766 __tmp.put_f32_le(self.I);
31767 __tmp.put_f32_le(self.D);
31768 __tmp.put_u8(self.axis as u8);
31769 __tmp.put_f32_le(self.SRate);
31770 __tmp.put_f32_le(self.PDmod);
31771 if matches!(version, MavlinkVersion::V2) {
31772 let len = __tmp.len();
31773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31774 } else {
31775 __tmp.len()
31776 }
31777 }
31778}
31779#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
31780#[doc = "id: 4"]
31781#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
31782#[derive(Debug, Clone, PartialEq)]
31783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31785pub struct PING_DATA {
31786 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31787 pub time_usec: u64,
31788 #[doc = "PING sequence"]
31789 pub seq: u32,
31790 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
31791 pub target_system: u8,
31792 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
31793 pub target_component: u8,
31794}
31795impl PING_DATA {
31796 pub const ENCODED_LEN: usize = 14usize;
31797 pub const DEFAULT: Self = Self {
31798 time_usec: 0_u64,
31799 seq: 0_u32,
31800 target_system: 0_u8,
31801 target_component: 0_u8,
31802 };
31803 #[cfg(feature = "arbitrary")]
31804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31805 use arbitrary::{Arbitrary, Unstructured};
31806 let mut buf = [0u8; 1024];
31807 rng.fill_bytes(&mut buf);
31808 let mut unstructured = Unstructured::new(&buf);
31809 Self::arbitrary(&mut unstructured).unwrap_or_default()
31810 }
31811}
31812impl Default for PING_DATA {
31813 fn default() -> Self {
31814 Self::DEFAULT.clone()
31815 }
31816}
31817impl MessageData for PING_DATA {
31818 type Message = MavMessage;
31819 const ID: u32 = 4u32;
31820 const NAME: &'static str = "PING";
31821 const EXTRA_CRC: u8 = 237u8;
31822 const ENCODED_LEN: usize = 14usize;
31823 fn deser(
31824 _version: MavlinkVersion,
31825 __input: &[u8],
31826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31827 let avail_len = __input.len();
31828 let mut payload_buf = [0; Self::ENCODED_LEN];
31829 let mut buf = if avail_len < Self::ENCODED_LEN {
31830 payload_buf[0..avail_len].copy_from_slice(__input);
31831 Bytes::new(&payload_buf)
31832 } else {
31833 Bytes::new(__input)
31834 };
31835 let mut __struct = Self::default();
31836 __struct.time_usec = buf.get_u64_le();
31837 __struct.seq = buf.get_u32_le();
31838 __struct.target_system = buf.get_u8();
31839 __struct.target_component = buf.get_u8();
31840 Ok(__struct)
31841 }
31842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31843 let mut __tmp = BytesMut::new(bytes);
31844 #[allow(clippy::absurd_extreme_comparisons)]
31845 #[allow(unused_comparisons)]
31846 if __tmp.remaining() < Self::ENCODED_LEN {
31847 panic!(
31848 "buffer is too small (need {} bytes, but got {})",
31849 Self::ENCODED_LEN,
31850 __tmp.remaining(),
31851 )
31852 }
31853 __tmp.put_u64_le(self.time_usec);
31854 __tmp.put_u32_le(self.seq);
31855 __tmp.put_u8(self.target_system);
31856 __tmp.put_u8(self.target_component);
31857 if matches!(version, MavlinkVersion::V2) {
31858 let len = __tmp.len();
31859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31860 } else {
31861 __tmp.len()
31862 }
31863 }
31864}
31865#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
31866#[doc = "id: 258"]
31867#[doc = "Control vehicle tone generation (buzzer)."]
31868#[derive(Debug, Clone, PartialEq)]
31869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31871pub struct PLAY_TUNE_DATA {
31872 #[doc = "System ID"]
31873 pub target_system: u8,
31874 #[doc = "Component ID"]
31875 pub target_component: u8,
31876 #[doc = "tune in board specific format"]
31877 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31878 pub tune: [u8; 30],
31879 #[doc = "tune extension (appended to tune)"]
31880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31881 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31882 pub tune2: [u8; 200],
31883}
31884impl PLAY_TUNE_DATA {
31885 pub const ENCODED_LEN: usize = 232usize;
31886 pub const DEFAULT: Self = Self {
31887 target_system: 0_u8,
31888 target_component: 0_u8,
31889 tune: [0_u8; 30usize],
31890 tune2: [0_u8; 200usize],
31891 };
31892 #[cfg(feature = "arbitrary")]
31893 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31894 use arbitrary::{Arbitrary, Unstructured};
31895 let mut buf = [0u8; 1024];
31896 rng.fill_bytes(&mut buf);
31897 let mut unstructured = Unstructured::new(&buf);
31898 Self::arbitrary(&mut unstructured).unwrap_or_default()
31899 }
31900}
31901impl Default for PLAY_TUNE_DATA {
31902 fn default() -> Self {
31903 Self::DEFAULT.clone()
31904 }
31905}
31906impl MessageData for PLAY_TUNE_DATA {
31907 type Message = MavMessage;
31908 const ID: u32 = 258u32;
31909 const NAME: &'static str = "PLAY_TUNE";
31910 const EXTRA_CRC: u8 = 187u8;
31911 const ENCODED_LEN: usize = 232usize;
31912 fn deser(
31913 _version: MavlinkVersion,
31914 __input: &[u8],
31915 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31916 let avail_len = __input.len();
31917 let mut payload_buf = [0; Self::ENCODED_LEN];
31918 let mut buf = if avail_len < Self::ENCODED_LEN {
31919 payload_buf[0..avail_len].copy_from_slice(__input);
31920 Bytes::new(&payload_buf)
31921 } else {
31922 Bytes::new(__input)
31923 };
31924 let mut __struct = Self::default();
31925 __struct.target_system = buf.get_u8();
31926 __struct.target_component = buf.get_u8();
31927 for v in &mut __struct.tune {
31928 let val = buf.get_u8();
31929 *v = val;
31930 }
31931 for v in &mut __struct.tune2 {
31932 let val = buf.get_u8();
31933 *v = val;
31934 }
31935 Ok(__struct)
31936 }
31937 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31938 let mut __tmp = BytesMut::new(bytes);
31939 #[allow(clippy::absurd_extreme_comparisons)]
31940 #[allow(unused_comparisons)]
31941 if __tmp.remaining() < Self::ENCODED_LEN {
31942 panic!(
31943 "buffer is too small (need {} bytes, but got {})",
31944 Self::ENCODED_LEN,
31945 __tmp.remaining(),
31946 )
31947 }
31948 __tmp.put_u8(self.target_system);
31949 __tmp.put_u8(self.target_component);
31950 for val in &self.tune {
31951 __tmp.put_u8(*val);
31952 }
31953 for val in &self.tune2 {
31954 __tmp.put_u8(*val);
31955 }
31956 if matches!(version, MavlinkVersion::V2) {
31957 let len = __tmp.len();
31958 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31959 } else {
31960 __tmp.len()
31961 }
31962 }
31963}
31964#[doc = "id: 400"]
31965#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
31966#[derive(Debug, Clone, PartialEq)]
31967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31969pub struct PLAY_TUNE_V2_DATA {
31970 #[doc = "Tune format"]
31971 pub format: TuneFormat,
31972 #[doc = "System ID"]
31973 pub target_system: u8,
31974 #[doc = "Component ID"]
31975 pub target_component: u8,
31976 #[doc = "Tune definition as a NULL-terminated string."]
31977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31978 pub tune: [u8; 248],
31979}
31980impl PLAY_TUNE_V2_DATA {
31981 pub const ENCODED_LEN: usize = 254usize;
31982 pub const DEFAULT: Self = Self {
31983 format: TuneFormat::DEFAULT,
31984 target_system: 0_u8,
31985 target_component: 0_u8,
31986 tune: [0_u8; 248usize],
31987 };
31988 #[cfg(feature = "arbitrary")]
31989 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31990 use arbitrary::{Arbitrary, Unstructured};
31991 let mut buf = [0u8; 1024];
31992 rng.fill_bytes(&mut buf);
31993 let mut unstructured = Unstructured::new(&buf);
31994 Self::arbitrary(&mut unstructured).unwrap_or_default()
31995 }
31996}
31997impl Default for PLAY_TUNE_V2_DATA {
31998 fn default() -> Self {
31999 Self::DEFAULT.clone()
32000 }
32001}
32002impl MessageData for PLAY_TUNE_V2_DATA {
32003 type Message = MavMessage;
32004 const ID: u32 = 400u32;
32005 const NAME: &'static str = "PLAY_TUNE_V2";
32006 const EXTRA_CRC: u8 = 110u8;
32007 const ENCODED_LEN: usize = 254usize;
32008 fn deser(
32009 _version: MavlinkVersion,
32010 __input: &[u8],
32011 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32012 let avail_len = __input.len();
32013 let mut payload_buf = [0; Self::ENCODED_LEN];
32014 let mut buf = if avail_len < Self::ENCODED_LEN {
32015 payload_buf[0..avail_len].copy_from_slice(__input);
32016 Bytes::new(&payload_buf)
32017 } else {
32018 Bytes::new(__input)
32019 };
32020 let mut __struct = Self::default();
32021 let tmp = buf.get_u32_le();
32022 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
32023 ::mavlink_core::error::ParserError::InvalidEnum {
32024 enum_type: "TuneFormat",
32025 value: tmp as u32,
32026 },
32027 )?;
32028 __struct.target_system = buf.get_u8();
32029 __struct.target_component = buf.get_u8();
32030 for v in &mut __struct.tune {
32031 let val = buf.get_u8();
32032 *v = val;
32033 }
32034 Ok(__struct)
32035 }
32036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32037 let mut __tmp = BytesMut::new(bytes);
32038 #[allow(clippy::absurd_extreme_comparisons)]
32039 #[allow(unused_comparisons)]
32040 if __tmp.remaining() < Self::ENCODED_LEN {
32041 panic!(
32042 "buffer is too small (need {} bytes, but got {})",
32043 Self::ENCODED_LEN,
32044 __tmp.remaining(),
32045 )
32046 }
32047 __tmp.put_u32_le(self.format as u32);
32048 __tmp.put_u8(self.target_system);
32049 __tmp.put_u8(self.target_component);
32050 for val in &self.tune {
32051 __tmp.put_u8(*val);
32052 }
32053 if matches!(version, MavlinkVersion::V2) {
32054 let len = __tmp.len();
32055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32056 } else {
32057 __tmp.len()
32058 }
32059 }
32060}
32061#[doc = "id: 87"]
32062#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32063#[derive(Debug, Clone, PartialEq)]
32064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32066pub struct POSITION_TARGET_GLOBAL_INT_DATA {
32067 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
32068 pub time_boot_ms: u32,
32069 #[doc = "Latitude in WGS84 frame"]
32070 pub lat_int: i32,
32071 #[doc = "Longitude in WGS84 frame"]
32072 pub lon_int: i32,
32073 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
32074 pub alt: f32,
32075 #[doc = "X velocity in NED frame"]
32076 pub vx: f32,
32077 #[doc = "Y velocity in NED frame"]
32078 pub vy: f32,
32079 #[doc = "Z velocity in NED frame"]
32080 pub vz: f32,
32081 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32082 pub afx: f32,
32083 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32084 pub afy: f32,
32085 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32086 pub afz: f32,
32087 #[doc = "yaw setpoint"]
32088 pub yaw: f32,
32089 #[doc = "yaw rate setpoint"]
32090 pub yaw_rate: f32,
32091 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
32092 pub type_mask: PositionTargetTypemask,
32093 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
32094 pub coordinate_frame: MavFrame,
32095}
32096impl POSITION_TARGET_GLOBAL_INT_DATA {
32097 pub const ENCODED_LEN: usize = 51usize;
32098 pub const DEFAULT: Self = Self {
32099 time_boot_ms: 0_u32,
32100 lat_int: 0_i32,
32101 lon_int: 0_i32,
32102 alt: 0.0_f32,
32103 vx: 0.0_f32,
32104 vy: 0.0_f32,
32105 vz: 0.0_f32,
32106 afx: 0.0_f32,
32107 afy: 0.0_f32,
32108 afz: 0.0_f32,
32109 yaw: 0.0_f32,
32110 yaw_rate: 0.0_f32,
32111 type_mask: PositionTargetTypemask::DEFAULT,
32112 coordinate_frame: MavFrame::DEFAULT,
32113 };
32114 #[cfg(feature = "arbitrary")]
32115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32116 use arbitrary::{Arbitrary, Unstructured};
32117 let mut buf = [0u8; 1024];
32118 rng.fill_bytes(&mut buf);
32119 let mut unstructured = Unstructured::new(&buf);
32120 Self::arbitrary(&mut unstructured).unwrap_or_default()
32121 }
32122}
32123impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
32124 fn default() -> Self {
32125 Self::DEFAULT.clone()
32126 }
32127}
32128impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
32129 type Message = MavMessage;
32130 const ID: u32 = 87u32;
32131 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
32132 const EXTRA_CRC: u8 = 150u8;
32133 const ENCODED_LEN: usize = 51usize;
32134 fn deser(
32135 _version: MavlinkVersion,
32136 __input: &[u8],
32137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32138 let avail_len = __input.len();
32139 let mut payload_buf = [0; Self::ENCODED_LEN];
32140 let mut buf = if avail_len < Self::ENCODED_LEN {
32141 payload_buf[0..avail_len].copy_from_slice(__input);
32142 Bytes::new(&payload_buf)
32143 } else {
32144 Bytes::new(__input)
32145 };
32146 let mut __struct = Self::default();
32147 __struct.time_boot_ms = buf.get_u32_le();
32148 __struct.lat_int = buf.get_i32_le();
32149 __struct.lon_int = buf.get_i32_le();
32150 __struct.alt = buf.get_f32_le();
32151 __struct.vx = buf.get_f32_le();
32152 __struct.vy = buf.get_f32_le();
32153 __struct.vz = buf.get_f32_le();
32154 __struct.afx = buf.get_f32_le();
32155 __struct.afy = buf.get_f32_le();
32156 __struct.afz = buf.get_f32_le();
32157 __struct.yaw = buf.get_f32_le();
32158 __struct.yaw_rate = buf.get_f32_le();
32159 let tmp = buf.get_u16_le();
32160 __struct.type_mask = PositionTargetTypemask::from_bits(
32161 tmp & PositionTargetTypemask::all().bits(),
32162 )
32163 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32164 flag_type: "PositionTargetTypemask",
32165 value: tmp as u32,
32166 })?;
32167 let tmp = buf.get_u8();
32168 __struct.coordinate_frame =
32169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32170 enum_type: "MavFrame",
32171 value: tmp as u32,
32172 })?;
32173 Ok(__struct)
32174 }
32175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32176 let mut __tmp = BytesMut::new(bytes);
32177 #[allow(clippy::absurd_extreme_comparisons)]
32178 #[allow(unused_comparisons)]
32179 if __tmp.remaining() < Self::ENCODED_LEN {
32180 panic!(
32181 "buffer is too small (need {} bytes, but got {})",
32182 Self::ENCODED_LEN,
32183 __tmp.remaining(),
32184 )
32185 }
32186 __tmp.put_u32_le(self.time_boot_ms);
32187 __tmp.put_i32_le(self.lat_int);
32188 __tmp.put_i32_le(self.lon_int);
32189 __tmp.put_f32_le(self.alt);
32190 __tmp.put_f32_le(self.vx);
32191 __tmp.put_f32_le(self.vy);
32192 __tmp.put_f32_le(self.vz);
32193 __tmp.put_f32_le(self.afx);
32194 __tmp.put_f32_le(self.afy);
32195 __tmp.put_f32_le(self.afz);
32196 __tmp.put_f32_le(self.yaw);
32197 __tmp.put_f32_le(self.yaw_rate);
32198 __tmp.put_u16_le(self.type_mask.bits());
32199 __tmp.put_u8(self.coordinate_frame as u8);
32200 if matches!(version, MavlinkVersion::V2) {
32201 let len = __tmp.len();
32202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32203 } else {
32204 __tmp.len()
32205 }
32206 }
32207}
32208#[doc = "id: 85"]
32209#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32210#[derive(Debug, Clone, PartialEq)]
32211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32213pub struct POSITION_TARGET_LOCAL_NED_DATA {
32214 #[doc = "Timestamp (time since system boot)."]
32215 pub time_boot_ms: u32,
32216 #[doc = "X Position in NED frame"]
32217 pub x: f32,
32218 #[doc = "Y Position in NED frame"]
32219 pub y: f32,
32220 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
32221 pub z: f32,
32222 #[doc = "X velocity in NED frame"]
32223 pub vx: f32,
32224 #[doc = "Y velocity in NED frame"]
32225 pub vy: f32,
32226 #[doc = "Z velocity in NED frame"]
32227 pub vz: f32,
32228 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32229 pub afx: f32,
32230 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32231 pub afy: f32,
32232 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
32233 pub afz: f32,
32234 #[doc = "yaw setpoint"]
32235 pub yaw: f32,
32236 #[doc = "yaw rate setpoint"]
32237 pub yaw_rate: f32,
32238 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
32239 pub type_mask: PositionTargetTypemask,
32240 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
32241 pub coordinate_frame: MavFrame,
32242}
32243impl POSITION_TARGET_LOCAL_NED_DATA {
32244 pub const ENCODED_LEN: usize = 51usize;
32245 pub const DEFAULT: Self = Self {
32246 time_boot_ms: 0_u32,
32247 x: 0.0_f32,
32248 y: 0.0_f32,
32249 z: 0.0_f32,
32250 vx: 0.0_f32,
32251 vy: 0.0_f32,
32252 vz: 0.0_f32,
32253 afx: 0.0_f32,
32254 afy: 0.0_f32,
32255 afz: 0.0_f32,
32256 yaw: 0.0_f32,
32257 yaw_rate: 0.0_f32,
32258 type_mask: PositionTargetTypemask::DEFAULT,
32259 coordinate_frame: MavFrame::DEFAULT,
32260 };
32261 #[cfg(feature = "arbitrary")]
32262 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32263 use arbitrary::{Arbitrary, Unstructured};
32264 let mut buf = [0u8; 1024];
32265 rng.fill_bytes(&mut buf);
32266 let mut unstructured = Unstructured::new(&buf);
32267 Self::arbitrary(&mut unstructured).unwrap_or_default()
32268 }
32269}
32270impl Default for POSITION_TARGET_LOCAL_NED_DATA {
32271 fn default() -> Self {
32272 Self::DEFAULT.clone()
32273 }
32274}
32275impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
32276 type Message = MavMessage;
32277 const ID: u32 = 85u32;
32278 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
32279 const EXTRA_CRC: u8 = 140u8;
32280 const ENCODED_LEN: usize = 51usize;
32281 fn deser(
32282 _version: MavlinkVersion,
32283 __input: &[u8],
32284 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32285 let avail_len = __input.len();
32286 let mut payload_buf = [0; Self::ENCODED_LEN];
32287 let mut buf = if avail_len < Self::ENCODED_LEN {
32288 payload_buf[0..avail_len].copy_from_slice(__input);
32289 Bytes::new(&payload_buf)
32290 } else {
32291 Bytes::new(__input)
32292 };
32293 let mut __struct = Self::default();
32294 __struct.time_boot_ms = buf.get_u32_le();
32295 __struct.x = buf.get_f32_le();
32296 __struct.y = buf.get_f32_le();
32297 __struct.z = buf.get_f32_le();
32298 __struct.vx = buf.get_f32_le();
32299 __struct.vy = buf.get_f32_le();
32300 __struct.vz = buf.get_f32_le();
32301 __struct.afx = buf.get_f32_le();
32302 __struct.afy = buf.get_f32_le();
32303 __struct.afz = buf.get_f32_le();
32304 __struct.yaw = buf.get_f32_le();
32305 __struct.yaw_rate = buf.get_f32_le();
32306 let tmp = buf.get_u16_le();
32307 __struct.type_mask = PositionTargetTypemask::from_bits(
32308 tmp & PositionTargetTypemask::all().bits(),
32309 )
32310 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32311 flag_type: "PositionTargetTypemask",
32312 value: tmp as u32,
32313 })?;
32314 let tmp = buf.get_u8();
32315 __struct.coordinate_frame =
32316 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32317 enum_type: "MavFrame",
32318 value: tmp as u32,
32319 })?;
32320 Ok(__struct)
32321 }
32322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32323 let mut __tmp = BytesMut::new(bytes);
32324 #[allow(clippy::absurd_extreme_comparisons)]
32325 #[allow(unused_comparisons)]
32326 if __tmp.remaining() < Self::ENCODED_LEN {
32327 panic!(
32328 "buffer is too small (need {} bytes, but got {})",
32329 Self::ENCODED_LEN,
32330 __tmp.remaining(),
32331 )
32332 }
32333 __tmp.put_u32_le(self.time_boot_ms);
32334 __tmp.put_f32_le(self.x);
32335 __tmp.put_f32_le(self.y);
32336 __tmp.put_f32_le(self.z);
32337 __tmp.put_f32_le(self.vx);
32338 __tmp.put_f32_le(self.vy);
32339 __tmp.put_f32_le(self.vz);
32340 __tmp.put_f32_le(self.afx);
32341 __tmp.put_f32_le(self.afy);
32342 __tmp.put_f32_le(self.afz);
32343 __tmp.put_f32_le(self.yaw);
32344 __tmp.put_f32_le(self.yaw_rate);
32345 __tmp.put_u16_le(self.type_mask.bits());
32346 __tmp.put_u8(self.coordinate_frame as u8);
32347 if matches!(version, MavlinkVersion::V2) {
32348 let len = __tmp.len();
32349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32350 } else {
32351 __tmp.len()
32352 }
32353 }
32354}
32355#[doc = "id: 125"]
32356#[doc = "Power supply status."]
32357#[derive(Debug, Clone, PartialEq)]
32358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32360pub struct POWER_STATUS_DATA {
32361 #[doc = "5V rail voltage."]
32362 pub Vcc: u16,
32363 #[doc = "Servo rail voltage."]
32364 pub Vservo: u16,
32365 #[doc = "Bitmap of power supply status flags."]
32366 pub flags: MavPowerStatus,
32367}
32368impl POWER_STATUS_DATA {
32369 pub const ENCODED_LEN: usize = 6usize;
32370 pub const DEFAULT: Self = Self {
32371 Vcc: 0_u16,
32372 Vservo: 0_u16,
32373 flags: MavPowerStatus::DEFAULT,
32374 };
32375 #[cfg(feature = "arbitrary")]
32376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32377 use arbitrary::{Arbitrary, Unstructured};
32378 let mut buf = [0u8; 1024];
32379 rng.fill_bytes(&mut buf);
32380 let mut unstructured = Unstructured::new(&buf);
32381 Self::arbitrary(&mut unstructured).unwrap_or_default()
32382 }
32383}
32384impl Default for POWER_STATUS_DATA {
32385 fn default() -> Self {
32386 Self::DEFAULT.clone()
32387 }
32388}
32389impl MessageData for POWER_STATUS_DATA {
32390 type Message = MavMessage;
32391 const ID: u32 = 125u32;
32392 const NAME: &'static str = "POWER_STATUS";
32393 const EXTRA_CRC: u8 = 203u8;
32394 const ENCODED_LEN: usize = 6usize;
32395 fn deser(
32396 _version: MavlinkVersion,
32397 __input: &[u8],
32398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32399 let avail_len = __input.len();
32400 let mut payload_buf = [0; Self::ENCODED_LEN];
32401 let mut buf = if avail_len < Self::ENCODED_LEN {
32402 payload_buf[0..avail_len].copy_from_slice(__input);
32403 Bytes::new(&payload_buf)
32404 } else {
32405 Bytes::new(__input)
32406 };
32407 let mut __struct = Self::default();
32408 __struct.Vcc = buf.get_u16_le();
32409 __struct.Vservo = buf.get_u16_le();
32410 let tmp = buf.get_u16_le();
32411 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
32412 ::mavlink_core::error::ParserError::InvalidFlag {
32413 flag_type: "MavPowerStatus",
32414 value: tmp as u32,
32415 },
32416 )?;
32417 Ok(__struct)
32418 }
32419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32420 let mut __tmp = BytesMut::new(bytes);
32421 #[allow(clippy::absurd_extreme_comparisons)]
32422 #[allow(unused_comparisons)]
32423 if __tmp.remaining() < Self::ENCODED_LEN {
32424 panic!(
32425 "buffer is too small (need {} bytes, but got {})",
32426 Self::ENCODED_LEN,
32427 __tmp.remaining(),
32428 )
32429 }
32430 __tmp.put_u16_le(self.Vcc);
32431 __tmp.put_u16_le(self.Vservo);
32432 __tmp.put_u16_le(self.flags.bits());
32433 if matches!(version, MavlinkVersion::V2) {
32434 let len = __tmp.len();
32435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32436 } else {
32437 __tmp.len()
32438 }
32439 }
32440}
32441#[doc = "id: 300"]
32442#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32443#[derive(Debug, Clone, PartialEq)]
32444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32446pub struct PROTOCOL_VERSION_DATA {
32447 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
32448 pub version: u16,
32449 #[doc = "Minimum MAVLink version supported"]
32450 pub min_version: u16,
32451 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
32452 pub max_version: u16,
32453 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
32454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32455 pub spec_version_hash: [u8; 8],
32456 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
32457 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32458 pub library_version_hash: [u8; 8],
32459}
32460impl PROTOCOL_VERSION_DATA {
32461 pub const ENCODED_LEN: usize = 22usize;
32462 pub const DEFAULT: Self = Self {
32463 version: 0_u16,
32464 min_version: 0_u16,
32465 max_version: 0_u16,
32466 spec_version_hash: [0_u8; 8usize],
32467 library_version_hash: [0_u8; 8usize],
32468 };
32469 #[cfg(feature = "arbitrary")]
32470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32471 use arbitrary::{Arbitrary, Unstructured};
32472 let mut buf = [0u8; 1024];
32473 rng.fill_bytes(&mut buf);
32474 let mut unstructured = Unstructured::new(&buf);
32475 Self::arbitrary(&mut unstructured).unwrap_or_default()
32476 }
32477}
32478impl Default for PROTOCOL_VERSION_DATA {
32479 fn default() -> Self {
32480 Self::DEFAULT.clone()
32481 }
32482}
32483impl MessageData for PROTOCOL_VERSION_DATA {
32484 type Message = MavMessage;
32485 const ID: u32 = 300u32;
32486 const NAME: &'static str = "PROTOCOL_VERSION";
32487 const EXTRA_CRC: u8 = 217u8;
32488 const ENCODED_LEN: usize = 22usize;
32489 fn deser(
32490 _version: MavlinkVersion,
32491 __input: &[u8],
32492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32493 let avail_len = __input.len();
32494 let mut payload_buf = [0; Self::ENCODED_LEN];
32495 let mut buf = if avail_len < Self::ENCODED_LEN {
32496 payload_buf[0..avail_len].copy_from_slice(__input);
32497 Bytes::new(&payload_buf)
32498 } else {
32499 Bytes::new(__input)
32500 };
32501 let mut __struct = Self::default();
32502 __struct.version = buf.get_u16_le();
32503 __struct.min_version = buf.get_u16_le();
32504 __struct.max_version = buf.get_u16_le();
32505 for v in &mut __struct.spec_version_hash {
32506 let val = buf.get_u8();
32507 *v = val;
32508 }
32509 for v in &mut __struct.library_version_hash {
32510 let val = buf.get_u8();
32511 *v = val;
32512 }
32513 Ok(__struct)
32514 }
32515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32516 let mut __tmp = BytesMut::new(bytes);
32517 #[allow(clippy::absurd_extreme_comparisons)]
32518 #[allow(unused_comparisons)]
32519 if __tmp.remaining() < Self::ENCODED_LEN {
32520 panic!(
32521 "buffer is too small (need {} bytes, but got {})",
32522 Self::ENCODED_LEN,
32523 __tmp.remaining(),
32524 )
32525 }
32526 __tmp.put_u16_le(self.version);
32527 __tmp.put_u16_le(self.min_version);
32528 __tmp.put_u16_le(self.max_version);
32529 for val in &self.spec_version_hash {
32530 __tmp.put_u8(*val);
32531 }
32532 for val in &self.library_version_hash {
32533 __tmp.put_u8(*val);
32534 }
32535 if matches!(version, MavlinkVersion::V2) {
32536 let len = __tmp.len();
32537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32538 } else {
32539 __tmp.len()
32540 }
32541 }
32542}
32543#[doc = "id: 166"]
32544#[doc = "Status generated by radio."]
32545#[derive(Debug, Clone, PartialEq)]
32546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32548pub struct RADIO_DATA {
32549 #[doc = "Receive errors."]
32550 pub rxerrors: u16,
32551 #[doc = "Count of error corrected packets."]
32552 pub fixed: u16,
32553 #[doc = "Local signal strength."]
32554 pub rssi: u8,
32555 #[doc = "Remote signal strength."]
32556 pub remrssi: u8,
32557 #[doc = "How full the tx buffer is."]
32558 pub txbuf: u8,
32559 #[doc = "Background noise level."]
32560 pub noise: u8,
32561 #[doc = "Remote background noise level."]
32562 pub remnoise: u8,
32563}
32564impl RADIO_DATA {
32565 pub const ENCODED_LEN: usize = 9usize;
32566 pub const DEFAULT: Self = Self {
32567 rxerrors: 0_u16,
32568 fixed: 0_u16,
32569 rssi: 0_u8,
32570 remrssi: 0_u8,
32571 txbuf: 0_u8,
32572 noise: 0_u8,
32573 remnoise: 0_u8,
32574 };
32575 #[cfg(feature = "arbitrary")]
32576 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32577 use arbitrary::{Arbitrary, Unstructured};
32578 let mut buf = [0u8; 1024];
32579 rng.fill_bytes(&mut buf);
32580 let mut unstructured = Unstructured::new(&buf);
32581 Self::arbitrary(&mut unstructured).unwrap_or_default()
32582 }
32583}
32584impl Default for RADIO_DATA {
32585 fn default() -> Self {
32586 Self::DEFAULT.clone()
32587 }
32588}
32589impl MessageData for RADIO_DATA {
32590 type Message = MavMessage;
32591 const ID: u32 = 166u32;
32592 const NAME: &'static str = "RADIO";
32593 const EXTRA_CRC: u8 = 21u8;
32594 const ENCODED_LEN: usize = 9usize;
32595 fn deser(
32596 _version: MavlinkVersion,
32597 __input: &[u8],
32598 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32599 let avail_len = __input.len();
32600 let mut payload_buf = [0; Self::ENCODED_LEN];
32601 let mut buf = if avail_len < Self::ENCODED_LEN {
32602 payload_buf[0..avail_len].copy_from_slice(__input);
32603 Bytes::new(&payload_buf)
32604 } else {
32605 Bytes::new(__input)
32606 };
32607 let mut __struct = Self::default();
32608 __struct.rxerrors = buf.get_u16_le();
32609 __struct.fixed = buf.get_u16_le();
32610 __struct.rssi = buf.get_u8();
32611 __struct.remrssi = buf.get_u8();
32612 __struct.txbuf = buf.get_u8();
32613 __struct.noise = buf.get_u8();
32614 __struct.remnoise = buf.get_u8();
32615 Ok(__struct)
32616 }
32617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32618 let mut __tmp = BytesMut::new(bytes);
32619 #[allow(clippy::absurd_extreme_comparisons)]
32620 #[allow(unused_comparisons)]
32621 if __tmp.remaining() < Self::ENCODED_LEN {
32622 panic!(
32623 "buffer is too small (need {} bytes, but got {})",
32624 Self::ENCODED_LEN,
32625 __tmp.remaining(),
32626 )
32627 }
32628 __tmp.put_u16_le(self.rxerrors);
32629 __tmp.put_u16_le(self.fixed);
32630 __tmp.put_u8(self.rssi);
32631 __tmp.put_u8(self.remrssi);
32632 __tmp.put_u8(self.txbuf);
32633 __tmp.put_u8(self.noise);
32634 __tmp.put_u8(self.remnoise);
32635 if matches!(version, MavlinkVersion::V2) {
32636 let len = __tmp.len();
32637 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32638 } else {
32639 __tmp.len()
32640 }
32641 }
32642}
32643#[doc = "id: 109"]
32644#[doc = "Status generated by radio and injected into MAVLink stream."]
32645#[derive(Debug, Clone, PartialEq)]
32646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32648pub struct RADIO_STATUS_DATA {
32649 #[doc = "Count of radio packet receive errors (since boot)."]
32650 pub rxerrors: u16,
32651 #[doc = "Count of error corrected radio packets (since boot)."]
32652 pub fixed: u16,
32653 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
32654 pub rssi: u8,
32655 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
32656 pub remrssi: u8,
32657 #[doc = "Remaining free transmitter buffer space."]
32658 pub txbuf: u8,
32659 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
32660 pub noise: u8,
32661 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
32662 pub remnoise: u8,
32663}
32664impl RADIO_STATUS_DATA {
32665 pub const ENCODED_LEN: usize = 9usize;
32666 pub const DEFAULT: Self = Self {
32667 rxerrors: 0_u16,
32668 fixed: 0_u16,
32669 rssi: 0_u8,
32670 remrssi: 0_u8,
32671 txbuf: 0_u8,
32672 noise: 0_u8,
32673 remnoise: 0_u8,
32674 };
32675 #[cfg(feature = "arbitrary")]
32676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32677 use arbitrary::{Arbitrary, Unstructured};
32678 let mut buf = [0u8; 1024];
32679 rng.fill_bytes(&mut buf);
32680 let mut unstructured = Unstructured::new(&buf);
32681 Self::arbitrary(&mut unstructured).unwrap_or_default()
32682 }
32683}
32684impl Default for RADIO_STATUS_DATA {
32685 fn default() -> Self {
32686 Self::DEFAULT.clone()
32687 }
32688}
32689impl MessageData for RADIO_STATUS_DATA {
32690 type Message = MavMessage;
32691 const ID: u32 = 109u32;
32692 const NAME: &'static str = "RADIO_STATUS";
32693 const EXTRA_CRC: u8 = 185u8;
32694 const ENCODED_LEN: usize = 9usize;
32695 fn deser(
32696 _version: MavlinkVersion,
32697 __input: &[u8],
32698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32699 let avail_len = __input.len();
32700 let mut payload_buf = [0; Self::ENCODED_LEN];
32701 let mut buf = if avail_len < Self::ENCODED_LEN {
32702 payload_buf[0..avail_len].copy_from_slice(__input);
32703 Bytes::new(&payload_buf)
32704 } else {
32705 Bytes::new(__input)
32706 };
32707 let mut __struct = Self::default();
32708 __struct.rxerrors = buf.get_u16_le();
32709 __struct.fixed = buf.get_u16_le();
32710 __struct.rssi = buf.get_u8();
32711 __struct.remrssi = buf.get_u8();
32712 __struct.txbuf = buf.get_u8();
32713 __struct.noise = buf.get_u8();
32714 __struct.remnoise = buf.get_u8();
32715 Ok(__struct)
32716 }
32717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32718 let mut __tmp = BytesMut::new(bytes);
32719 #[allow(clippy::absurd_extreme_comparisons)]
32720 #[allow(unused_comparisons)]
32721 if __tmp.remaining() < Self::ENCODED_LEN {
32722 panic!(
32723 "buffer is too small (need {} bytes, but got {})",
32724 Self::ENCODED_LEN,
32725 __tmp.remaining(),
32726 )
32727 }
32728 __tmp.put_u16_le(self.rxerrors);
32729 __tmp.put_u16_le(self.fixed);
32730 __tmp.put_u8(self.rssi);
32731 __tmp.put_u8(self.remrssi);
32732 __tmp.put_u8(self.txbuf);
32733 __tmp.put_u8(self.noise);
32734 __tmp.put_u8(self.remnoise);
32735 if matches!(version, MavlinkVersion::V2) {
32736 let len = __tmp.len();
32737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32738 } else {
32739 __tmp.len()
32740 }
32741 }
32742}
32743#[doc = "id: 176"]
32744#[doc = "Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid."]
32745#[derive(Debug, Clone, PartialEq)]
32746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32748pub struct RALLY_FETCH_POINT_DATA {
32749 #[doc = "System ID."]
32750 pub target_system: u8,
32751 #[doc = "Component ID."]
32752 pub target_component: u8,
32753 #[doc = "Point index (first point is 0)."]
32754 pub idx: u8,
32755}
32756impl RALLY_FETCH_POINT_DATA {
32757 pub const ENCODED_LEN: usize = 3usize;
32758 pub const DEFAULT: Self = Self {
32759 target_system: 0_u8,
32760 target_component: 0_u8,
32761 idx: 0_u8,
32762 };
32763 #[cfg(feature = "arbitrary")]
32764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32765 use arbitrary::{Arbitrary, Unstructured};
32766 let mut buf = [0u8; 1024];
32767 rng.fill_bytes(&mut buf);
32768 let mut unstructured = Unstructured::new(&buf);
32769 Self::arbitrary(&mut unstructured).unwrap_or_default()
32770 }
32771}
32772impl Default for RALLY_FETCH_POINT_DATA {
32773 fn default() -> Self {
32774 Self::DEFAULT.clone()
32775 }
32776}
32777impl MessageData for RALLY_FETCH_POINT_DATA {
32778 type Message = MavMessage;
32779 const ID: u32 = 176u32;
32780 const NAME: &'static str = "RALLY_FETCH_POINT";
32781 const EXTRA_CRC: u8 = 234u8;
32782 const ENCODED_LEN: usize = 3usize;
32783 fn deser(
32784 _version: MavlinkVersion,
32785 __input: &[u8],
32786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32787 let avail_len = __input.len();
32788 let mut payload_buf = [0; Self::ENCODED_LEN];
32789 let mut buf = if avail_len < Self::ENCODED_LEN {
32790 payload_buf[0..avail_len].copy_from_slice(__input);
32791 Bytes::new(&payload_buf)
32792 } else {
32793 Bytes::new(__input)
32794 };
32795 let mut __struct = Self::default();
32796 __struct.target_system = buf.get_u8();
32797 __struct.target_component = buf.get_u8();
32798 __struct.idx = buf.get_u8();
32799 Ok(__struct)
32800 }
32801 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32802 let mut __tmp = BytesMut::new(bytes);
32803 #[allow(clippy::absurd_extreme_comparisons)]
32804 #[allow(unused_comparisons)]
32805 if __tmp.remaining() < Self::ENCODED_LEN {
32806 panic!(
32807 "buffer is too small (need {} bytes, but got {})",
32808 Self::ENCODED_LEN,
32809 __tmp.remaining(),
32810 )
32811 }
32812 __tmp.put_u8(self.target_system);
32813 __tmp.put_u8(self.target_component);
32814 __tmp.put_u8(self.idx);
32815 if matches!(version, MavlinkVersion::V2) {
32816 let len = __tmp.len();
32817 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32818 } else {
32819 __tmp.len()
32820 }
32821 }
32822}
32823#[doc = "id: 175"]
32824#[doc = "GCS."]
32825#[derive(Debug, Clone, PartialEq)]
32826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32828pub struct RALLY_POINT_DATA {
32829 #[doc = "Latitude of point."]
32830 pub lat: i32,
32831 #[doc = "Longitude of point."]
32832 pub lng: i32,
32833 #[doc = "Transit / loiter altitude relative to home."]
32834 pub alt: i16,
32835 #[doc = "Break altitude relative to home."]
32836 pub break_alt: i16,
32837 #[doc = "Heading to aim for when landing."]
32838 pub land_dir: u16,
32839 #[doc = "System ID."]
32840 pub target_system: u8,
32841 #[doc = "Component ID."]
32842 pub target_component: u8,
32843 #[doc = "Point index (first point is 0)."]
32844 pub idx: u8,
32845 #[doc = "Total number of points (for sanity checking)."]
32846 pub count: u8,
32847 #[doc = "Configuration flags."]
32848 pub flags: RallyFlags,
32849}
32850impl RALLY_POINT_DATA {
32851 pub const ENCODED_LEN: usize = 19usize;
32852 pub const DEFAULT: Self = Self {
32853 lat: 0_i32,
32854 lng: 0_i32,
32855 alt: 0_i16,
32856 break_alt: 0_i16,
32857 land_dir: 0_u16,
32858 target_system: 0_u8,
32859 target_component: 0_u8,
32860 idx: 0_u8,
32861 count: 0_u8,
32862 flags: RallyFlags::DEFAULT,
32863 };
32864 #[cfg(feature = "arbitrary")]
32865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32866 use arbitrary::{Arbitrary, Unstructured};
32867 let mut buf = [0u8; 1024];
32868 rng.fill_bytes(&mut buf);
32869 let mut unstructured = Unstructured::new(&buf);
32870 Self::arbitrary(&mut unstructured).unwrap_or_default()
32871 }
32872}
32873impl Default for RALLY_POINT_DATA {
32874 fn default() -> Self {
32875 Self::DEFAULT.clone()
32876 }
32877}
32878impl MessageData for RALLY_POINT_DATA {
32879 type Message = MavMessage;
32880 const ID: u32 = 175u32;
32881 const NAME: &'static str = "RALLY_POINT";
32882 const EXTRA_CRC: u8 = 138u8;
32883 const ENCODED_LEN: usize = 19usize;
32884 fn deser(
32885 _version: MavlinkVersion,
32886 __input: &[u8],
32887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32888 let avail_len = __input.len();
32889 let mut payload_buf = [0; Self::ENCODED_LEN];
32890 let mut buf = if avail_len < Self::ENCODED_LEN {
32891 payload_buf[0..avail_len].copy_from_slice(__input);
32892 Bytes::new(&payload_buf)
32893 } else {
32894 Bytes::new(__input)
32895 };
32896 let mut __struct = Self::default();
32897 __struct.lat = buf.get_i32_le();
32898 __struct.lng = buf.get_i32_le();
32899 __struct.alt = buf.get_i16_le();
32900 __struct.break_alt = buf.get_i16_le();
32901 __struct.land_dir = buf.get_u16_le();
32902 __struct.target_system = buf.get_u8();
32903 __struct.target_component = buf.get_u8();
32904 __struct.idx = buf.get_u8();
32905 __struct.count = buf.get_u8();
32906 let tmp = buf.get_u8();
32907 __struct.flags =
32908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32909 enum_type: "RallyFlags",
32910 value: tmp as u32,
32911 })?;
32912 Ok(__struct)
32913 }
32914 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32915 let mut __tmp = BytesMut::new(bytes);
32916 #[allow(clippy::absurd_extreme_comparisons)]
32917 #[allow(unused_comparisons)]
32918 if __tmp.remaining() < Self::ENCODED_LEN {
32919 panic!(
32920 "buffer is too small (need {} bytes, but got {})",
32921 Self::ENCODED_LEN,
32922 __tmp.remaining(),
32923 )
32924 }
32925 __tmp.put_i32_le(self.lat);
32926 __tmp.put_i32_le(self.lng);
32927 __tmp.put_i16_le(self.alt);
32928 __tmp.put_i16_le(self.break_alt);
32929 __tmp.put_u16_le(self.land_dir);
32930 __tmp.put_u8(self.target_system);
32931 __tmp.put_u8(self.target_component);
32932 __tmp.put_u8(self.idx);
32933 __tmp.put_u8(self.count);
32934 __tmp.put_u8(self.flags as u8);
32935 if matches!(version, MavlinkVersion::V2) {
32936 let len = __tmp.len();
32937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32938 } else {
32939 __tmp.len()
32940 }
32941 }
32942}
32943#[doc = "id: 173"]
32944#[doc = "Rangefinder reporting."]
32945#[derive(Debug, Clone, PartialEq)]
32946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32948pub struct RANGEFINDER_DATA {
32949 #[doc = "Distance."]
32950 pub distance: f32,
32951 #[doc = "Raw voltage if available, zero otherwise."]
32952 pub voltage: f32,
32953}
32954impl RANGEFINDER_DATA {
32955 pub const ENCODED_LEN: usize = 8usize;
32956 pub const DEFAULT: Self = Self {
32957 distance: 0.0_f32,
32958 voltage: 0.0_f32,
32959 };
32960 #[cfg(feature = "arbitrary")]
32961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32962 use arbitrary::{Arbitrary, Unstructured};
32963 let mut buf = [0u8; 1024];
32964 rng.fill_bytes(&mut buf);
32965 let mut unstructured = Unstructured::new(&buf);
32966 Self::arbitrary(&mut unstructured).unwrap_or_default()
32967 }
32968}
32969impl Default for RANGEFINDER_DATA {
32970 fn default() -> Self {
32971 Self::DEFAULT.clone()
32972 }
32973}
32974impl MessageData for RANGEFINDER_DATA {
32975 type Message = MavMessage;
32976 const ID: u32 = 173u32;
32977 const NAME: &'static str = "RANGEFINDER";
32978 const EXTRA_CRC: u8 = 83u8;
32979 const ENCODED_LEN: usize = 8usize;
32980 fn deser(
32981 _version: MavlinkVersion,
32982 __input: &[u8],
32983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32984 let avail_len = __input.len();
32985 let mut payload_buf = [0; Self::ENCODED_LEN];
32986 let mut buf = if avail_len < Self::ENCODED_LEN {
32987 payload_buf[0..avail_len].copy_from_slice(__input);
32988 Bytes::new(&payload_buf)
32989 } else {
32990 Bytes::new(__input)
32991 };
32992 let mut __struct = Self::default();
32993 __struct.distance = buf.get_f32_le();
32994 __struct.voltage = buf.get_f32_le();
32995 Ok(__struct)
32996 }
32997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32998 let mut __tmp = BytesMut::new(bytes);
32999 #[allow(clippy::absurd_extreme_comparisons)]
33000 #[allow(unused_comparisons)]
33001 if __tmp.remaining() < Self::ENCODED_LEN {
33002 panic!(
33003 "buffer is too small (need {} bytes, but got {})",
33004 Self::ENCODED_LEN,
33005 __tmp.remaining(),
33006 )
33007 }
33008 __tmp.put_f32_le(self.distance);
33009 __tmp.put_f32_le(self.voltage);
33010 if matches!(version, MavlinkVersion::V2) {
33011 let len = __tmp.len();
33012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33013 } else {
33014 __tmp.len()
33015 }
33016 }
33017}
33018#[doc = "id: 27"]
33019#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33020#[derive(Debug, Clone, PartialEq)]
33021#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33023pub struct RAW_IMU_DATA {
33024 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33025 pub time_usec: u64,
33026 #[doc = "X acceleration (raw)"]
33027 pub xacc: i16,
33028 #[doc = "Y acceleration (raw)"]
33029 pub yacc: i16,
33030 #[doc = "Z acceleration (raw)"]
33031 pub zacc: i16,
33032 #[doc = "Angular speed around X axis (raw)"]
33033 pub xgyro: i16,
33034 #[doc = "Angular speed around Y axis (raw)"]
33035 pub ygyro: i16,
33036 #[doc = "Angular speed around Z axis (raw)"]
33037 pub zgyro: i16,
33038 #[doc = "X Magnetic field (raw)"]
33039 pub xmag: i16,
33040 #[doc = "Y Magnetic field (raw)"]
33041 pub ymag: i16,
33042 #[doc = "Z Magnetic field (raw)"]
33043 pub zmag: i16,
33044 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
33045 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33046 pub id: u8,
33047 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
33048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33049 pub temperature: i16,
33050}
33051impl RAW_IMU_DATA {
33052 pub const ENCODED_LEN: usize = 29usize;
33053 pub const DEFAULT: Self = Self {
33054 time_usec: 0_u64,
33055 xacc: 0_i16,
33056 yacc: 0_i16,
33057 zacc: 0_i16,
33058 xgyro: 0_i16,
33059 ygyro: 0_i16,
33060 zgyro: 0_i16,
33061 xmag: 0_i16,
33062 ymag: 0_i16,
33063 zmag: 0_i16,
33064 id: 0_u8,
33065 temperature: 0_i16,
33066 };
33067 #[cfg(feature = "arbitrary")]
33068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33069 use arbitrary::{Arbitrary, Unstructured};
33070 let mut buf = [0u8; 1024];
33071 rng.fill_bytes(&mut buf);
33072 let mut unstructured = Unstructured::new(&buf);
33073 Self::arbitrary(&mut unstructured).unwrap_or_default()
33074 }
33075}
33076impl Default for RAW_IMU_DATA {
33077 fn default() -> Self {
33078 Self::DEFAULT.clone()
33079 }
33080}
33081impl MessageData for RAW_IMU_DATA {
33082 type Message = MavMessage;
33083 const ID: u32 = 27u32;
33084 const NAME: &'static str = "RAW_IMU";
33085 const EXTRA_CRC: u8 = 144u8;
33086 const ENCODED_LEN: usize = 29usize;
33087 fn deser(
33088 _version: MavlinkVersion,
33089 __input: &[u8],
33090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33091 let avail_len = __input.len();
33092 let mut payload_buf = [0; Self::ENCODED_LEN];
33093 let mut buf = if avail_len < Self::ENCODED_LEN {
33094 payload_buf[0..avail_len].copy_from_slice(__input);
33095 Bytes::new(&payload_buf)
33096 } else {
33097 Bytes::new(__input)
33098 };
33099 let mut __struct = Self::default();
33100 __struct.time_usec = buf.get_u64_le();
33101 __struct.xacc = buf.get_i16_le();
33102 __struct.yacc = buf.get_i16_le();
33103 __struct.zacc = buf.get_i16_le();
33104 __struct.xgyro = buf.get_i16_le();
33105 __struct.ygyro = buf.get_i16_le();
33106 __struct.zgyro = buf.get_i16_le();
33107 __struct.xmag = buf.get_i16_le();
33108 __struct.ymag = buf.get_i16_le();
33109 __struct.zmag = buf.get_i16_le();
33110 __struct.id = buf.get_u8();
33111 __struct.temperature = buf.get_i16_le();
33112 Ok(__struct)
33113 }
33114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33115 let mut __tmp = BytesMut::new(bytes);
33116 #[allow(clippy::absurd_extreme_comparisons)]
33117 #[allow(unused_comparisons)]
33118 if __tmp.remaining() < Self::ENCODED_LEN {
33119 panic!(
33120 "buffer is too small (need {} bytes, but got {})",
33121 Self::ENCODED_LEN,
33122 __tmp.remaining(),
33123 )
33124 }
33125 __tmp.put_u64_le(self.time_usec);
33126 __tmp.put_i16_le(self.xacc);
33127 __tmp.put_i16_le(self.yacc);
33128 __tmp.put_i16_le(self.zacc);
33129 __tmp.put_i16_le(self.xgyro);
33130 __tmp.put_i16_le(self.ygyro);
33131 __tmp.put_i16_le(self.zgyro);
33132 __tmp.put_i16_le(self.xmag);
33133 __tmp.put_i16_le(self.ymag);
33134 __tmp.put_i16_le(self.zmag);
33135 __tmp.put_u8(self.id);
33136 __tmp.put_i16_le(self.temperature);
33137 if matches!(version, MavlinkVersion::V2) {
33138 let len = __tmp.len();
33139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33140 } else {
33141 __tmp.len()
33142 }
33143 }
33144}
33145#[doc = "id: 28"]
33146#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33147#[derive(Debug, Clone, PartialEq)]
33148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33150pub struct RAW_PRESSURE_DATA {
33151 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33152 pub time_usec: u64,
33153 #[doc = "Absolute pressure (raw)"]
33154 pub press_abs: i16,
33155 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
33156 pub press_diff1: i16,
33157 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
33158 pub press_diff2: i16,
33159 #[doc = "Raw Temperature measurement (raw)"]
33160 pub temperature: i16,
33161}
33162impl RAW_PRESSURE_DATA {
33163 pub const ENCODED_LEN: usize = 16usize;
33164 pub const DEFAULT: Self = Self {
33165 time_usec: 0_u64,
33166 press_abs: 0_i16,
33167 press_diff1: 0_i16,
33168 press_diff2: 0_i16,
33169 temperature: 0_i16,
33170 };
33171 #[cfg(feature = "arbitrary")]
33172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33173 use arbitrary::{Arbitrary, Unstructured};
33174 let mut buf = [0u8; 1024];
33175 rng.fill_bytes(&mut buf);
33176 let mut unstructured = Unstructured::new(&buf);
33177 Self::arbitrary(&mut unstructured).unwrap_or_default()
33178 }
33179}
33180impl Default for RAW_PRESSURE_DATA {
33181 fn default() -> Self {
33182 Self::DEFAULT.clone()
33183 }
33184}
33185impl MessageData for RAW_PRESSURE_DATA {
33186 type Message = MavMessage;
33187 const ID: u32 = 28u32;
33188 const NAME: &'static str = "RAW_PRESSURE";
33189 const EXTRA_CRC: u8 = 67u8;
33190 const ENCODED_LEN: usize = 16usize;
33191 fn deser(
33192 _version: MavlinkVersion,
33193 __input: &[u8],
33194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33195 let avail_len = __input.len();
33196 let mut payload_buf = [0; Self::ENCODED_LEN];
33197 let mut buf = if avail_len < Self::ENCODED_LEN {
33198 payload_buf[0..avail_len].copy_from_slice(__input);
33199 Bytes::new(&payload_buf)
33200 } else {
33201 Bytes::new(__input)
33202 };
33203 let mut __struct = Self::default();
33204 __struct.time_usec = buf.get_u64_le();
33205 __struct.press_abs = buf.get_i16_le();
33206 __struct.press_diff1 = buf.get_i16_le();
33207 __struct.press_diff2 = buf.get_i16_le();
33208 __struct.temperature = buf.get_i16_le();
33209 Ok(__struct)
33210 }
33211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33212 let mut __tmp = BytesMut::new(bytes);
33213 #[allow(clippy::absurd_extreme_comparisons)]
33214 #[allow(unused_comparisons)]
33215 if __tmp.remaining() < Self::ENCODED_LEN {
33216 panic!(
33217 "buffer is too small (need {} bytes, but got {})",
33218 Self::ENCODED_LEN,
33219 __tmp.remaining(),
33220 )
33221 }
33222 __tmp.put_u64_le(self.time_usec);
33223 __tmp.put_i16_le(self.press_abs);
33224 __tmp.put_i16_le(self.press_diff1);
33225 __tmp.put_i16_le(self.press_diff2);
33226 __tmp.put_i16_le(self.temperature);
33227 if matches!(version, MavlinkVersion::V2) {
33228 let len = __tmp.len();
33229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33230 } else {
33231 __tmp.len()
33232 }
33233 }
33234}
33235#[doc = "id: 339"]
33236#[doc = "RPM sensor data message."]
33237#[derive(Debug, Clone, PartialEq)]
33238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33240pub struct RAW_RPM_DATA {
33241 #[doc = "Indicated rate"]
33242 pub frequency: f32,
33243 #[doc = "Index of this RPM sensor (0-indexed)"]
33244 pub index: u8,
33245}
33246impl RAW_RPM_DATA {
33247 pub const ENCODED_LEN: usize = 5usize;
33248 pub const DEFAULT: Self = Self {
33249 frequency: 0.0_f32,
33250 index: 0_u8,
33251 };
33252 #[cfg(feature = "arbitrary")]
33253 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33254 use arbitrary::{Arbitrary, Unstructured};
33255 let mut buf = [0u8; 1024];
33256 rng.fill_bytes(&mut buf);
33257 let mut unstructured = Unstructured::new(&buf);
33258 Self::arbitrary(&mut unstructured).unwrap_or_default()
33259 }
33260}
33261impl Default for RAW_RPM_DATA {
33262 fn default() -> Self {
33263 Self::DEFAULT.clone()
33264 }
33265}
33266impl MessageData for RAW_RPM_DATA {
33267 type Message = MavMessage;
33268 const ID: u32 = 339u32;
33269 const NAME: &'static str = "RAW_RPM";
33270 const EXTRA_CRC: u8 = 199u8;
33271 const ENCODED_LEN: usize = 5usize;
33272 fn deser(
33273 _version: MavlinkVersion,
33274 __input: &[u8],
33275 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33276 let avail_len = __input.len();
33277 let mut payload_buf = [0; Self::ENCODED_LEN];
33278 let mut buf = if avail_len < Self::ENCODED_LEN {
33279 payload_buf[0..avail_len].copy_from_slice(__input);
33280 Bytes::new(&payload_buf)
33281 } else {
33282 Bytes::new(__input)
33283 };
33284 let mut __struct = Self::default();
33285 __struct.frequency = buf.get_f32_le();
33286 __struct.index = buf.get_u8();
33287 Ok(__struct)
33288 }
33289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33290 let mut __tmp = BytesMut::new(bytes);
33291 #[allow(clippy::absurd_extreme_comparisons)]
33292 #[allow(unused_comparisons)]
33293 if __tmp.remaining() < Self::ENCODED_LEN {
33294 panic!(
33295 "buffer is too small (need {} bytes, but got {})",
33296 Self::ENCODED_LEN,
33297 __tmp.remaining(),
33298 )
33299 }
33300 __tmp.put_f32_le(self.frequency);
33301 __tmp.put_u8(self.index);
33302 if matches!(version, MavlinkVersion::V2) {
33303 let len = __tmp.len();
33304 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33305 } else {
33306 __tmp.len()
33307 }
33308 }
33309}
33310#[doc = "id: 65"]
33311#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33312#[derive(Debug, Clone, PartialEq)]
33313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33315pub struct RC_CHANNELS_DATA {
33316 #[doc = "Timestamp (time since system boot)."]
33317 pub time_boot_ms: u32,
33318 #[doc = "RC channel 1 value."]
33319 pub chan1_raw: u16,
33320 #[doc = "RC channel 2 value."]
33321 pub chan2_raw: u16,
33322 #[doc = "RC channel 3 value."]
33323 pub chan3_raw: u16,
33324 #[doc = "RC channel 4 value."]
33325 pub chan4_raw: u16,
33326 #[doc = "RC channel 5 value."]
33327 pub chan5_raw: u16,
33328 #[doc = "RC channel 6 value."]
33329 pub chan6_raw: u16,
33330 #[doc = "RC channel 7 value."]
33331 pub chan7_raw: u16,
33332 #[doc = "RC channel 8 value."]
33333 pub chan8_raw: u16,
33334 #[doc = "RC channel 9 value."]
33335 pub chan9_raw: u16,
33336 #[doc = "RC channel 10 value."]
33337 pub chan10_raw: u16,
33338 #[doc = "RC channel 11 value."]
33339 pub chan11_raw: u16,
33340 #[doc = "RC channel 12 value."]
33341 pub chan12_raw: u16,
33342 #[doc = "RC channel 13 value."]
33343 pub chan13_raw: u16,
33344 #[doc = "RC channel 14 value."]
33345 pub chan14_raw: u16,
33346 #[doc = "RC channel 15 value."]
33347 pub chan15_raw: u16,
33348 #[doc = "RC channel 16 value."]
33349 pub chan16_raw: u16,
33350 #[doc = "RC channel 17 value."]
33351 pub chan17_raw: u16,
33352 #[doc = "RC channel 18 value."]
33353 pub chan18_raw: u16,
33354 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
33355 pub chancount: u8,
33356 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
33357 pub rssi: u8,
33358}
33359impl RC_CHANNELS_DATA {
33360 pub const ENCODED_LEN: usize = 42usize;
33361 pub const DEFAULT: Self = Self {
33362 time_boot_ms: 0_u32,
33363 chan1_raw: 0_u16,
33364 chan2_raw: 0_u16,
33365 chan3_raw: 0_u16,
33366 chan4_raw: 0_u16,
33367 chan5_raw: 0_u16,
33368 chan6_raw: 0_u16,
33369 chan7_raw: 0_u16,
33370 chan8_raw: 0_u16,
33371 chan9_raw: 0_u16,
33372 chan10_raw: 0_u16,
33373 chan11_raw: 0_u16,
33374 chan12_raw: 0_u16,
33375 chan13_raw: 0_u16,
33376 chan14_raw: 0_u16,
33377 chan15_raw: 0_u16,
33378 chan16_raw: 0_u16,
33379 chan17_raw: 0_u16,
33380 chan18_raw: 0_u16,
33381 chancount: 0_u8,
33382 rssi: 0_u8,
33383 };
33384 #[cfg(feature = "arbitrary")]
33385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33386 use arbitrary::{Arbitrary, Unstructured};
33387 let mut buf = [0u8; 1024];
33388 rng.fill_bytes(&mut buf);
33389 let mut unstructured = Unstructured::new(&buf);
33390 Self::arbitrary(&mut unstructured).unwrap_or_default()
33391 }
33392}
33393impl Default for RC_CHANNELS_DATA {
33394 fn default() -> Self {
33395 Self::DEFAULT.clone()
33396 }
33397}
33398impl MessageData for RC_CHANNELS_DATA {
33399 type Message = MavMessage;
33400 const ID: u32 = 65u32;
33401 const NAME: &'static str = "RC_CHANNELS";
33402 const EXTRA_CRC: u8 = 118u8;
33403 const ENCODED_LEN: usize = 42usize;
33404 fn deser(
33405 _version: MavlinkVersion,
33406 __input: &[u8],
33407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33408 let avail_len = __input.len();
33409 let mut payload_buf = [0; Self::ENCODED_LEN];
33410 let mut buf = if avail_len < Self::ENCODED_LEN {
33411 payload_buf[0..avail_len].copy_from_slice(__input);
33412 Bytes::new(&payload_buf)
33413 } else {
33414 Bytes::new(__input)
33415 };
33416 let mut __struct = Self::default();
33417 __struct.time_boot_ms = buf.get_u32_le();
33418 __struct.chan1_raw = buf.get_u16_le();
33419 __struct.chan2_raw = buf.get_u16_le();
33420 __struct.chan3_raw = buf.get_u16_le();
33421 __struct.chan4_raw = buf.get_u16_le();
33422 __struct.chan5_raw = buf.get_u16_le();
33423 __struct.chan6_raw = buf.get_u16_le();
33424 __struct.chan7_raw = buf.get_u16_le();
33425 __struct.chan8_raw = buf.get_u16_le();
33426 __struct.chan9_raw = buf.get_u16_le();
33427 __struct.chan10_raw = buf.get_u16_le();
33428 __struct.chan11_raw = buf.get_u16_le();
33429 __struct.chan12_raw = buf.get_u16_le();
33430 __struct.chan13_raw = buf.get_u16_le();
33431 __struct.chan14_raw = buf.get_u16_le();
33432 __struct.chan15_raw = buf.get_u16_le();
33433 __struct.chan16_raw = buf.get_u16_le();
33434 __struct.chan17_raw = buf.get_u16_le();
33435 __struct.chan18_raw = buf.get_u16_le();
33436 __struct.chancount = buf.get_u8();
33437 __struct.rssi = buf.get_u8();
33438 Ok(__struct)
33439 }
33440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33441 let mut __tmp = BytesMut::new(bytes);
33442 #[allow(clippy::absurd_extreme_comparisons)]
33443 #[allow(unused_comparisons)]
33444 if __tmp.remaining() < Self::ENCODED_LEN {
33445 panic!(
33446 "buffer is too small (need {} bytes, but got {})",
33447 Self::ENCODED_LEN,
33448 __tmp.remaining(),
33449 )
33450 }
33451 __tmp.put_u32_le(self.time_boot_ms);
33452 __tmp.put_u16_le(self.chan1_raw);
33453 __tmp.put_u16_le(self.chan2_raw);
33454 __tmp.put_u16_le(self.chan3_raw);
33455 __tmp.put_u16_le(self.chan4_raw);
33456 __tmp.put_u16_le(self.chan5_raw);
33457 __tmp.put_u16_le(self.chan6_raw);
33458 __tmp.put_u16_le(self.chan7_raw);
33459 __tmp.put_u16_le(self.chan8_raw);
33460 __tmp.put_u16_le(self.chan9_raw);
33461 __tmp.put_u16_le(self.chan10_raw);
33462 __tmp.put_u16_le(self.chan11_raw);
33463 __tmp.put_u16_le(self.chan12_raw);
33464 __tmp.put_u16_le(self.chan13_raw);
33465 __tmp.put_u16_le(self.chan14_raw);
33466 __tmp.put_u16_le(self.chan15_raw);
33467 __tmp.put_u16_le(self.chan16_raw);
33468 __tmp.put_u16_le(self.chan17_raw);
33469 __tmp.put_u16_le(self.chan18_raw);
33470 __tmp.put_u8(self.chancount);
33471 __tmp.put_u8(self.rssi);
33472 if matches!(version, MavlinkVersion::V2) {
33473 let len = __tmp.len();
33474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33475 } else {
33476 __tmp.len()
33477 }
33478 }
33479}
33480#[doc = "id: 70"]
33481#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33482#[derive(Debug, Clone, PartialEq)]
33483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33485pub struct RC_CHANNELS_OVERRIDE_DATA {
33486 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33487 pub chan1_raw: u16,
33488 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33489 pub chan2_raw: u16,
33490 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33491 pub chan3_raw: u16,
33492 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33493 pub chan4_raw: u16,
33494 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33495 pub chan5_raw: u16,
33496 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33497 pub chan6_raw: u16,
33498 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33499 pub chan7_raw: u16,
33500 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
33501 pub chan8_raw: u16,
33502 #[doc = "System ID"]
33503 pub target_system: u8,
33504 #[doc = "Component ID"]
33505 pub target_component: u8,
33506 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33508 pub chan9_raw: u16,
33509 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33511 pub chan10_raw: u16,
33512 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33513 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33514 pub chan11_raw: u16,
33515 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33516 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33517 pub chan12_raw: u16,
33518 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33519 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33520 pub chan13_raw: u16,
33521 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33522 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33523 pub chan14_raw: u16,
33524 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33525 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33526 pub chan15_raw: u16,
33527 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33528 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33529 pub chan16_raw: u16,
33530 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33531 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33532 pub chan17_raw: u16,
33533 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
33534 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
33535 pub chan18_raw: u16,
33536}
33537impl RC_CHANNELS_OVERRIDE_DATA {
33538 pub const ENCODED_LEN: usize = 38usize;
33539 pub const DEFAULT: Self = Self {
33540 chan1_raw: 0_u16,
33541 chan2_raw: 0_u16,
33542 chan3_raw: 0_u16,
33543 chan4_raw: 0_u16,
33544 chan5_raw: 0_u16,
33545 chan6_raw: 0_u16,
33546 chan7_raw: 0_u16,
33547 chan8_raw: 0_u16,
33548 target_system: 0_u8,
33549 target_component: 0_u8,
33550 chan9_raw: 0_u16,
33551 chan10_raw: 0_u16,
33552 chan11_raw: 0_u16,
33553 chan12_raw: 0_u16,
33554 chan13_raw: 0_u16,
33555 chan14_raw: 0_u16,
33556 chan15_raw: 0_u16,
33557 chan16_raw: 0_u16,
33558 chan17_raw: 0_u16,
33559 chan18_raw: 0_u16,
33560 };
33561 #[cfg(feature = "arbitrary")]
33562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33563 use arbitrary::{Arbitrary, Unstructured};
33564 let mut buf = [0u8; 1024];
33565 rng.fill_bytes(&mut buf);
33566 let mut unstructured = Unstructured::new(&buf);
33567 Self::arbitrary(&mut unstructured).unwrap_or_default()
33568 }
33569}
33570impl Default for RC_CHANNELS_OVERRIDE_DATA {
33571 fn default() -> Self {
33572 Self::DEFAULT.clone()
33573 }
33574}
33575impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
33576 type Message = MavMessage;
33577 const ID: u32 = 70u32;
33578 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
33579 const EXTRA_CRC: u8 = 124u8;
33580 const ENCODED_LEN: usize = 38usize;
33581 fn deser(
33582 _version: MavlinkVersion,
33583 __input: &[u8],
33584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33585 let avail_len = __input.len();
33586 let mut payload_buf = [0; Self::ENCODED_LEN];
33587 let mut buf = if avail_len < Self::ENCODED_LEN {
33588 payload_buf[0..avail_len].copy_from_slice(__input);
33589 Bytes::new(&payload_buf)
33590 } else {
33591 Bytes::new(__input)
33592 };
33593 let mut __struct = Self::default();
33594 __struct.chan1_raw = buf.get_u16_le();
33595 __struct.chan2_raw = buf.get_u16_le();
33596 __struct.chan3_raw = buf.get_u16_le();
33597 __struct.chan4_raw = buf.get_u16_le();
33598 __struct.chan5_raw = buf.get_u16_le();
33599 __struct.chan6_raw = buf.get_u16_le();
33600 __struct.chan7_raw = buf.get_u16_le();
33601 __struct.chan8_raw = buf.get_u16_le();
33602 __struct.target_system = buf.get_u8();
33603 __struct.target_component = buf.get_u8();
33604 __struct.chan9_raw = buf.get_u16_le();
33605 __struct.chan10_raw = buf.get_u16_le();
33606 __struct.chan11_raw = buf.get_u16_le();
33607 __struct.chan12_raw = buf.get_u16_le();
33608 __struct.chan13_raw = buf.get_u16_le();
33609 __struct.chan14_raw = buf.get_u16_le();
33610 __struct.chan15_raw = buf.get_u16_le();
33611 __struct.chan16_raw = buf.get_u16_le();
33612 __struct.chan17_raw = buf.get_u16_le();
33613 __struct.chan18_raw = buf.get_u16_le();
33614 Ok(__struct)
33615 }
33616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33617 let mut __tmp = BytesMut::new(bytes);
33618 #[allow(clippy::absurd_extreme_comparisons)]
33619 #[allow(unused_comparisons)]
33620 if __tmp.remaining() < Self::ENCODED_LEN {
33621 panic!(
33622 "buffer is too small (need {} bytes, but got {})",
33623 Self::ENCODED_LEN,
33624 __tmp.remaining(),
33625 )
33626 }
33627 __tmp.put_u16_le(self.chan1_raw);
33628 __tmp.put_u16_le(self.chan2_raw);
33629 __tmp.put_u16_le(self.chan3_raw);
33630 __tmp.put_u16_le(self.chan4_raw);
33631 __tmp.put_u16_le(self.chan5_raw);
33632 __tmp.put_u16_le(self.chan6_raw);
33633 __tmp.put_u16_le(self.chan7_raw);
33634 __tmp.put_u16_le(self.chan8_raw);
33635 __tmp.put_u8(self.target_system);
33636 __tmp.put_u8(self.target_component);
33637 __tmp.put_u16_le(self.chan9_raw);
33638 __tmp.put_u16_le(self.chan10_raw);
33639 __tmp.put_u16_le(self.chan11_raw);
33640 __tmp.put_u16_le(self.chan12_raw);
33641 __tmp.put_u16_le(self.chan13_raw);
33642 __tmp.put_u16_le(self.chan14_raw);
33643 __tmp.put_u16_le(self.chan15_raw);
33644 __tmp.put_u16_le(self.chan16_raw);
33645 __tmp.put_u16_le(self.chan17_raw);
33646 __tmp.put_u16_le(self.chan18_raw);
33647 if matches!(version, MavlinkVersion::V2) {
33648 let len = __tmp.len();
33649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33650 } else {
33651 __tmp.len()
33652 }
33653 }
33654}
33655#[doc = "id: 35"]
33656#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33657#[derive(Debug, Clone, PartialEq)]
33658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33660pub struct RC_CHANNELS_RAW_DATA {
33661 #[doc = "Timestamp (time since system boot)."]
33662 pub time_boot_ms: u32,
33663 #[doc = "RC channel 1 value."]
33664 pub chan1_raw: u16,
33665 #[doc = "RC channel 2 value."]
33666 pub chan2_raw: u16,
33667 #[doc = "RC channel 3 value."]
33668 pub chan3_raw: u16,
33669 #[doc = "RC channel 4 value."]
33670 pub chan4_raw: u16,
33671 #[doc = "RC channel 5 value."]
33672 pub chan5_raw: u16,
33673 #[doc = "RC channel 6 value."]
33674 pub chan6_raw: u16,
33675 #[doc = "RC channel 7 value."]
33676 pub chan7_raw: u16,
33677 #[doc = "RC channel 8 value."]
33678 pub chan8_raw: u16,
33679 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
33680 pub port: u8,
33681 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
33682 pub rssi: u8,
33683}
33684impl RC_CHANNELS_RAW_DATA {
33685 pub const ENCODED_LEN: usize = 22usize;
33686 pub const DEFAULT: Self = Self {
33687 time_boot_ms: 0_u32,
33688 chan1_raw: 0_u16,
33689 chan2_raw: 0_u16,
33690 chan3_raw: 0_u16,
33691 chan4_raw: 0_u16,
33692 chan5_raw: 0_u16,
33693 chan6_raw: 0_u16,
33694 chan7_raw: 0_u16,
33695 chan8_raw: 0_u16,
33696 port: 0_u8,
33697 rssi: 0_u8,
33698 };
33699 #[cfg(feature = "arbitrary")]
33700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33701 use arbitrary::{Arbitrary, Unstructured};
33702 let mut buf = [0u8; 1024];
33703 rng.fill_bytes(&mut buf);
33704 let mut unstructured = Unstructured::new(&buf);
33705 Self::arbitrary(&mut unstructured).unwrap_or_default()
33706 }
33707}
33708impl Default for RC_CHANNELS_RAW_DATA {
33709 fn default() -> Self {
33710 Self::DEFAULT.clone()
33711 }
33712}
33713impl MessageData for RC_CHANNELS_RAW_DATA {
33714 type Message = MavMessage;
33715 const ID: u32 = 35u32;
33716 const NAME: &'static str = "RC_CHANNELS_RAW";
33717 const EXTRA_CRC: u8 = 244u8;
33718 const ENCODED_LEN: usize = 22usize;
33719 fn deser(
33720 _version: MavlinkVersion,
33721 __input: &[u8],
33722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33723 let avail_len = __input.len();
33724 let mut payload_buf = [0; Self::ENCODED_LEN];
33725 let mut buf = if avail_len < Self::ENCODED_LEN {
33726 payload_buf[0..avail_len].copy_from_slice(__input);
33727 Bytes::new(&payload_buf)
33728 } else {
33729 Bytes::new(__input)
33730 };
33731 let mut __struct = Self::default();
33732 __struct.time_boot_ms = buf.get_u32_le();
33733 __struct.chan1_raw = buf.get_u16_le();
33734 __struct.chan2_raw = buf.get_u16_le();
33735 __struct.chan3_raw = buf.get_u16_le();
33736 __struct.chan4_raw = buf.get_u16_le();
33737 __struct.chan5_raw = buf.get_u16_le();
33738 __struct.chan6_raw = buf.get_u16_le();
33739 __struct.chan7_raw = buf.get_u16_le();
33740 __struct.chan8_raw = buf.get_u16_le();
33741 __struct.port = buf.get_u8();
33742 __struct.rssi = buf.get_u8();
33743 Ok(__struct)
33744 }
33745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33746 let mut __tmp = BytesMut::new(bytes);
33747 #[allow(clippy::absurd_extreme_comparisons)]
33748 #[allow(unused_comparisons)]
33749 if __tmp.remaining() < Self::ENCODED_LEN {
33750 panic!(
33751 "buffer is too small (need {} bytes, but got {})",
33752 Self::ENCODED_LEN,
33753 __tmp.remaining(),
33754 )
33755 }
33756 __tmp.put_u32_le(self.time_boot_ms);
33757 __tmp.put_u16_le(self.chan1_raw);
33758 __tmp.put_u16_le(self.chan2_raw);
33759 __tmp.put_u16_le(self.chan3_raw);
33760 __tmp.put_u16_le(self.chan4_raw);
33761 __tmp.put_u16_le(self.chan5_raw);
33762 __tmp.put_u16_le(self.chan6_raw);
33763 __tmp.put_u16_le(self.chan7_raw);
33764 __tmp.put_u16_le(self.chan8_raw);
33765 __tmp.put_u8(self.port);
33766 __tmp.put_u8(self.rssi);
33767 if matches!(version, MavlinkVersion::V2) {
33768 let len = __tmp.len();
33769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33770 } else {
33771 __tmp.len()
33772 }
33773 }
33774}
33775#[doc = "id: 34"]
33776#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33777#[derive(Debug, Clone, PartialEq)]
33778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33780pub struct RC_CHANNELS_SCALED_DATA {
33781 #[doc = "Timestamp (time since system boot)."]
33782 pub time_boot_ms: u32,
33783 #[doc = "RC channel 1 value scaled."]
33784 pub chan1_scaled: i16,
33785 #[doc = "RC channel 2 value scaled."]
33786 pub chan2_scaled: i16,
33787 #[doc = "RC channel 3 value scaled."]
33788 pub chan3_scaled: i16,
33789 #[doc = "RC channel 4 value scaled."]
33790 pub chan4_scaled: i16,
33791 #[doc = "RC channel 5 value scaled."]
33792 pub chan5_scaled: i16,
33793 #[doc = "RC channel 6 value scaled."]
33794 pub chan6_scaled: i16,
33795 #[doc = "RC channel 7 value scaled."]
33796 pub chan7_scaled: i16,
33797 #[doc = "RC channel 8 value scaled."]
33798 pub chan8_scaled: i16,
33799 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
33800 pub port: u8,
33801 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
33802 pub rssi: u8,
33803}
33804impl RC_CHANNELS_SCALED_DATA {
33805 pub const ENCODED_LEN: usize = 22usize;
33806 pub const DEFAULT: Self = Self {
33807 time_boot_ms: 0_u32,
33808 chan1_scaled: 0_i16,
33809 chan2_scaled: 0_i16,
33810 chan3_scaled: 0_i16,
33811 chan4_scaled: 0_i16,
33812 chan5_scaled: 0_i16,
33813 chan6_scaled: 0_i16,
33814 chan7_scaled: 0_i16,
33815 chan8_scaled: 0_i16,
33816 port: 0_u8,
33817 rssi: 0_u8,
33818 };
33819 #[cfg(feature = "arbitrary")]
33820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33821 use arbitrary::{Arbitrary, Unstructured};
33822 let mut buf = [0u8; 1024];
33823 rng.fill_bytes(&mut buf);
33824 let mut unstructured = Unstructured::new(&buf);
33825 Self::arbitrary(&mut unstructured).unwrap_or_default()
33826 }
33827}
33828impl Default for RC_CHANNELS_SCALED_DATA {
33829 fn default() -> Self {
33830 Self::DEFAULT.clone()
33831 }
33832}
33833impl MessageData for RC_CHANNELS_SCALED_DATA {
33834 type Message = MavMessage;
33835 const ID: u32 = 34u32;
33836 const NAME: &'static str = "RC_CHANNELS_SCALED";
33837 const EXTRA_CRC: u8 = 237u8;
33838 const ENCODED_LEN: usize = 22usize;
33839 fn deser(
33840 _version: MavlinkVersion,
33841 __input: &[u8],
33842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33843 let avail_len = __input.len();
33844 let mut payload_buf = [0; Self::ENCODED_LEN];
33845 let mut buf = if avail_len < Self::ENCODED_LEN {
33846 payload_buf[0..avail_len].copy_from_slice(__input);
33847 Bytes::new(&payload_buf)
33848 } else {
33849 Bytes::new(__input)
33850 };
33851 let mut __struct = Self::default();
33852 __struct.time_boot_ms = buf.get_u32_le();
33853 __struct.chan1_scaled = buf.get_i16_le();
33854 __struct.chan2_scaled = buf.get_i16_le();
33855 __struct.chan3_scaled = buf.get_i16_le();
33856 __struct.chan4_scaled = buf.get_i16_le();
33857 __struct.chan5_scaled = buf.get_i16_le();
33858 __struct.chan6_scaled = buf.get_i16_le();
33859 __struct.chan7_scaled = buf.get_i16_le();
33860 __struct.chan8_scaled = buf.get_i16_le();
33861 __struct.port = buf.get_u8();
33862 __struct.rssi = buf.get_u8();
33863 Ok(__struct)
33864 }
33865 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33866 let mut __tmp = BytesMut::new(bytes);
33867 #[allow(clippy::absurd_extreme_comparisons)]
33868 #[allow(unused_comparisons)]
33869 if __tmp.remaining() < Self::ENCODED_LEN {
33870 panic!(
33871 "buffer is too small (need {} bytes, but got {})",
33872 Self::ENCODED_LEN,
33873 __tmp.remaining(),
33874 )
33875 }
33876 __tmp.put_u32_le(self.time_boot_ms);
33877 __tmp.put_i16_le(self.chan1_scaled);
33878 __tmp.put_i16_le(self.chan2_scaled);
33879 __tmp.put_i16_le(self.chan3_scaled);
33880 __tmp.put_i16_le(self.chan4_scaled);
33881 __tmp.put_i16_le(self.chan5_scaled);
33882 __tmp.put_i16_le(self.chan6_scaled);
33883 __tmp.put_i16_le(self.chan7_scaled);
33884 __tmp.put_i16_le(self.chan8_scaled);
33885 __tmp.put_u8(self.port);
33886 __tmp.put_u8(self.rssi);
33887 if matches!(version, MavlinkVersion::V2) {
33888 let len = __tmp.len();
33889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33890 } else {
33891 __tmp.len()
33892 }
33893 }
33894}
33895#[doc = "id: 185"]
33896#[doc = "Send Status of each log block that autopilot board might have sent."]
33897#[derive(Debug, Clone, PartialEq)]
33898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33900pub struct REMOTE_LOG_BLOCK_STATUS_DATA {
33901 #[doc = "Log data block sequence number."]
33902 pub seqno: u32,
33903 #[doc = "System ID."]
33904 pub target_system: u8,
33905 #[doc = "Component ID."]
33906 pub target_component: u8,
33907 #[doc = "Log data block status."]
33908 pub status: MavRemoteLogDataBlockStatuses,
33909}
33910impl REMOTE_LOG_BLOCK_STATUS_DATA {
33911 pub const ENCODED_LEN: usize = 7usize;
33912 pub const DEFAULT: Self = Self {
33913 seqno: 0_u32,
33914 target_system: 0_u8,
33915 target_component: 0_u8,
33916 status: MavRemoteLogDataBlockStatuses::DEFAULT,
33917 };
33918 #[cfg(feature = "arbitrary")]
33919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33920 use arbitrary::{Arbitrary, Unstructured};
33921 let mut buf = [0u8; 1024];
33922 rng.fill_bytes(&mut buf);
33923 let mut unstructured = Unstructured::new(&buf);
33924 Self::arbitrary(&mut unstructured).unwrap_or_default()
33925 }
33926}
33927impl Default for REMOTE_LOG_BLOCK_STATUS_DATA {
33928 fn default() -> Self {
33929 Self::DEFAULT.clone()
33930 }
33931}
33932impl MessageData for REMOTE_LOG_BLOCK_STATUS_DATA {
33933 type Message = MavMessage;
33934 const ID: u32 = 185u32;
33935 const NAME: &'static str = "REMOTE_LOG_BLOCK_STATUS";
33936 const EXTRA_CRC: u8 = 186u8;
33937 const ENCODED_LEN: usize = 7usize;
33938 fn deser(
33939 _version: MavlinkVersion,
33940 __input: &[u8],
33941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33942 let avail_len = __input.len();
33943 let mut payload_buf = [0; Self::ENCODED_LEN];
33944 let mut buf = if avail_len < Self::ENCODED_LEN {
33945 payload_buf[0..avail_len].copy_from_slice(__input);
33946 Bytes::new(&payload_buf)
33947 } else {
33948 Bytes::new(__input)
33949 };
33950 let mut __struct = Self::default();
33951 __struct.seqno = buf.get_u32_le();
33952 __struct.target_system = buf.get_u8();
33953 __struct.target_component = buf.get_u8();
33954 let tmp = buf.get_u8();
33955 __struct.status =
33956 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
33957 enum_type: "MavRemoteLogDataBlockStatuses",
33958 value: tmp as u32,
33959 })?;
33960 Ok(__struct)
33961 }
33962 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33963 let mut __tmp = BytesMut::new(bytes);
33964 #[allow(clippy::absurd_extreme_comparisons)]
33965 #[allow(unused_comparisons)]
33966 if __tmp.remaining() < Self::ENCODED_LEN {
33967 panic!(
33968 "buffer is too small (need {} bytes, but got {})",
33969 Self::ENCODED_LEN,
33970 __tmp.remaining(),
33971 )
33972 }
33973 __tmp.put_u32_le(self.seqno);
33974 __tmp.put_u8(self.target_system);
33975 __tmp.put_u8(self.target_component);
33976 __tmp.put_u8(self.status as u8);
33977 if matches!(version, MavlinkVersion::V2) {
33978 let len = __tmp.len();
33979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33980 } else {
33981 __tmp.len()
33982 }
33983 }
33984}
33985#[doc = "id: 184"]
33986#[doc = "Send a block of log data to remote location."]
33987#[derive(Debug, Clone, PartialEq)]
33988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33990pub struct REMOTE_LOG_DATA_BLOCK_DATA {
33991 #[doc = "Log data block sequence number."]
33992 pub seqno: MavRemoteLogDataBlockCommands,
33993 #[doc = "System ID."]
33994 pub target_system: u8,
33995 #[doc = "Component ID."]
33996 pub target_component: u8,
33997 #[doc = "Log data block."]
33998 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
33999 pub data: [u8; 200],
34000}
34001impl REMOTE_LOG_DATA_BLOCK_DATA {
34002 pub const ENCODED_LEN: usize = 206usize;
34003 pub const DEFAULT: Self = Self {
34004 seqno: MavRemoteLogDataBlockCommands::DEFAULT,
34005 target_system: 0_u8,
34006 target_component: 0_u8,
34007 data: [0_u8; 200usize],
34008 };
34009 #[cfg(feature = "arbitrary")]
34010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34011 use arbitrary::{Arbitrary, Unstructured};
34012 let mut buf = [0u8; 1024];
34013 rng.fill_bytes(&mut buf);
34014 let mut unstructured = Unstructured::new(&buf);
34015 Self::arbitrary(&mut unstructured).unwrap_or_default()
34016 }
34017}
34018impl Default for REMOTE_LOG_DATA_BLOCK_DATA {
34019 fn default() -> Self {
34020 Self::DEFAULT.clone()
34021 }
34022}
34023impl MessageData for REMOTE_LOG_DATA_BLOCK_DATA {
34024 type Message = MavMessage;
34025 const ID: u32 = 184u32;
34026 const NAME: &'static str = "REMOTE_LOG_DATA_BLOCK";
34027 const EXTRA_CRC: u8 = 159u8;
34028 const ENCODED_LEN: usize = 206usize;
34029 fn deser(
34030 _version: MavlinkVersion,
34031 __input: &[u8],
34032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34033 let avail_len = __input.len();
34034 let mut payload_buf = [0; Self::ENCODED_LEN];
34035 let mut buf = if avail_len < Self::ENCODED_LEN {
34036 payload_buf[0..avail_len].copy_from_slice(__input);
34037 Bytes::new(&payload_buf)
34038 } else {
34039 Bytes::new(__input)
34040 };
34041 let mut __struct = Self::default();
34042 let tmp = buf.get_u32_le();
34043 __struct.seqno = FromPrimitive::from_u32(tmp).ok_or(
34044 ::mavlink_core::error::ParserError::InvalidEnum {
34045 enum_type: "MavRemoteLogDataBlockCommands",
34046 value: tmp as u32,
34047 },
34048 )?;
34049 __struct.target_system = buf.get_u8();
34050 __struct.target_component = buf.get_u8();
34051 for v in &mut __struct.data {
34052 let val = buf.get_u8();
34053 *v = val;
34054 }
34055 Ok(__struct)
34056 }
34057 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34058 let mut __tmp = BytesMut::new(bytes);
34059 #[allow(clippy::absurd_extreme_comparisons)]
34060 #[allow(unused_comparisons)]
34061 if __tmp.remaining() < Self::ENCODED_LEN {
34062 panic!(
34063 "buffer is too small (need {} bytes, but got {})",
34064 Self::ENCODED_LEN,
34065 __tmp.remaining(),
34066 )
34067 }
34068 __tmp.put_u32_le(self.seqno as u32);
34069 __tmp.put_u8(self.target_system);
34070 __tmp.put_u8(self.target_component);
34071 for val in &self.data {
34072 __tmp.put_u8(*val);
34073 }
34074 if matches!(version, MavlinkVersion::V2) {
34075 let len = __tmp.len();
34076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34077 } else {
34078 __tmp.len()
34079 }
34080 }
34081}
34082#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
34083#[doc = "id: 66"]
34084#[doc = "Request a data stream."]
34085#[derive(Debug, Clone, PartialEq)]
34086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34088pub struct REQUEST_DATA_STREAM_DATA {
34089 #[doc = "The requested message rate"]
34090 pub req_message_rate: u16,
34091 #[doc = "The target requested to send the message stream."]
34092 pub target_system: u8,
34093 #[doc = "The target requested to send the message stream."]
34094 pub target_component: u8,
34095 #[doc = "The ID of the requested data stream"]
34096 pub req_stream_id: u8,
34097 #[doc = "1 to start sending, 0 to stop sending."]
34098 pub start_stop: u8,
34099}
34100impl REQUEST_DATA_STREAM_DATA {
34101 pub const ENCODED_LEN: usize = 6usize;
34102 pub const DEFAULT: Self = Self {
34103 req_message_rate: 0_u16,
34104 target_system: 0_u8,
34105 target_component: 0_u8,
34106 req_stream_id: 0_u8,
34107 start_stop: 0_u8,
34108 };
34109 #[cfg(feature = "arbitrary")]
34110 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34111 use arbitrary::{Arbitrary, Unstructured};
34112 let mut buf = [0u8; 1024];
34113 rng.fill_bytes(&mut buf);
34114 let mut unstructured = Unstructured::new(&buf);
34115 Self::arbitrary(&mut unstructured).unwrap_or_default()
34116 }
34117}
34118impl Default for REQUEST_DATA_STREAM_DATA {
34119 fn default() -> Self {
34120 Self::DEFAULT.clone()
34121 }
34122}
34123impl MessageData for REQUEST_DATA_STREAM_DATA {
34124 type Message = MavMessage;
34125 const ID: u32 = 66u32;
34126 const NAME: &'static str = "REQUEST_DATA_STREAM";
34127 const EXTRA_CRC: u8 = 148u8;
34128 const ENCODED_LEN: usize = 6usize;
34129 fn deser(
34130 _version: MavlinkVersion,
34131 __input: &[u8],
34132 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34133 let avail_len = __input.len();
34134 let mut payload_buf = [0; Self::ENCODED_LEN];
34135 let mut buf = if avail_len < Self::ENCODED_LEN {
34136 payload_buf[0..avail_len].copy_from_slice(__input);
34137 Bytes::new(&payload_buf)
34138 } else {
34139 Bytes::new(__input)
34140 };
34141 let mut __struct = Self::default();
34142 __struct.req_message_rate = buf.get_u16_le();
34143 __struct.target_system = buf.get_u8();
34144 __struct.target_component = buf.get_u8();
34145 __struct.req_stream_id = buf.get_u8();
34146 __struct.start_stop = buf.get_u8();
34147 Ok(__struct)
34148 }
34149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34150 let mut __tmp = BytesMut::new(bytes);
34151 #[allow(clippy::absurd_extreme_comparisons)]
34152 #[allow(unused_comparisons)]
34153 if __tmp.remaining() < Self::ENCODED_LEN {
34154 panic!(
34155 "buffer is too small (need {} bytes, but got {})",
34156 Self::ENCODED_LEN,
34157 __tmp.remaining(),
34158 )
34159 }
34160 __tmp.put_u16_le(self.req_message_rate);
34161 __tmp.put_u8(self.target_system);
34162 __tmp.put_u8(self.target_component);
34163 __tmp.put_u8(self.req_stream_id);
34164 __tmp.put_u8(self.start_stop);
34165 if matches!(version, MavlinkVersion::V2) {
34166 let len = __tmp.len();
34167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34168 } else {
34169 __tmp.len()
34170 }
34171 }
34172}
34173#[doc = "id: 412"]
34174#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
34175#[derive(Debug, Clone, PartialEq)]
34176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34178pub struct REQUEST_EVENT_DATA {
34179 #[doc = "First sequence number of the requested event."]
34180 pub first_sequence: u16,
34181 #[doc = "Last sequence number of the requested event."]
34182 pub last_sequence: u16,
34183 #[doc = "System ID"]
34184 pub target_system: u8,
34185 #[doc = "Component ID"]
34186 pub target_component: u8,
34187}
34188impl REQUEST_EVENT_DATA {
34189 pub const ENCODED_LEN: usize = 6usize;
34190 pub const DEFAULT: Self = Self {
34191 first_sequence: 0_u16,
34192 last_sequence: 0_u16,
34193 target_system: 0_u8,
34194 target_component: 0_u8,
34195 };
34196 #[cfg(feature = "arbitrary")]
34197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34198 use arbitrary::{Arbitrary, Unstructured};
34199 let mut buf = [0u8; 1024];
34200 rng.fill_bytes(&mut buf);
34201 let mut unstructured = Unstructured::new(&buf);
34202 Self::arbitrary(&mut unstructured).unwrap_or_default()
34203 }
34204}
34205impl Default for REQUEST_EVENT_DATA {
34206 fn default() -> Self {
34207 Self::DEFAULT.clone()
34208 }
34209}
34210impl MessageData for REQUEST_EVENT_DATA {
34211 type Message = MavMessage;
34212 const ID: u32 = 412u32;
34213 const NAME: &'static str = "REQUEST_EVENT";
34214 const EXTRA_CRC: u8 = 33u8;
34215 const ENCODED_LEN: usize = 6usize;
34216 fn deser(
34217 _version: MavlinkVersion,
34218 __input: &[u8],
34219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34220 let avail_len = __input.len();
34221 let mut payload_buf = [0; Self::ENCODED_LEN];
34222 let mut buf = if avail_len < Self::ENCODED_LEN {
34223 payload_buf[0..avail_len].copy_from_slice(__input);
34224 Bytes::new(&payload_buf)
34225 } else {
34226 Bytes::new(__input)
34227 };
34228 let mut __struct = Self::default();
34229 __struct.first_sequence = buf.get_u16_le();
34230 __struct.last_sequence = buf.get_u16_le();
34231 __struct.target_system = buf.get_u8();
34232 __struct.target_component = buf.get_u8();
34233 Ok(__struct)
34234 }
34235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34236 let mut __tmp = BytesMut::new(bytes);
34237 #[allow(clippy::absurd_extreme_comparisons)]
34238 #[allow(unused_comparisons)]
34239 if __tmp.remaining() < Self::ENCODED_LEN {
34240 panic!(
34241 "buffer is too small (need {} bytes, but got {})",
34242 Self::ENCODED_LEN,
34243 __tmp.remaining(),
34244 )
34245 }
34246 __tmp.put_u16_le(self.first_sequence);
34247 __tmp.put_u16_le(self.last_sequence);
34248 __tmp.put_u8(self.target_system);
34249 __tmp.put_u8(self.target_component);
34250 if matches!(version, MavlinkVersion::V2) {
34251 let len = __tmp.len();
34252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34253 } else {
34254 __tmp.len()
34255 }
34256 }
34257}
34258#[doc = "id: 142"]
34259#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
34260#[derive(Debug, Clone, PartialEq)]
34261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34263pub struct RESOURCE_REQUEST_DATA {
34264 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
34265 pub request_id: u8,
34266 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
34267 pub uri_type: u8,
34268 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
34269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34270 pub uri: [u8; 120],
34271 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
34272 pub transfer_type: u8,
34273 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
34274 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
34275 pub storage: [u8; 120],
34276}
34277impl RESOURCE_REQUEST_DATA {
34278 pub const ENCODED_LEN: usize = 243usize;
34279 pub const DEFAULT: Self = Self {
34280 request_id: 0_u8,
34281 uri_type: 0_u8,
34282 uri: [0_u8; 120usize],
34283 transfer_type: 0_u8,
34284 storage: [0_u8; 120usize],
34285 };
34286 #[cfg(feature = "arbitrary")]
34287 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34288 use arbitrary::{Arbitrary, Unstructured};
34289 let mut buf = [0u8; 1024];
34290 rng.fill_bytes(&mut buf);
34291 let mut unstructured = Unstructured::new(&buf);
34292 Self::arbitrary(&mut unstructured).unwrap_or_default()
34293 }
34294}
34295impl Default for RESOURCE_REQUEST_DATA {
34296 fn default() -> Self {
34297 Self::DEFAULT.clone()
34298 }
34299}
34300impl MessageData for RESOURCE_REQUEST_DATA {
34301 type Message = MavMessage;
34302 const ID: u32 = 142u32;
34303 const NAME: &'static str = "RESOURCE_REQUEST";
34304 const EXTRA_CRC: u8 = 72u8;
34305 const ENCODED_LEN: usize = 243usize;
34306 fn deser(
34307 _version: MavlinkVersion,
34308 __input: &[u8],
34309 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34310 let avail_len = __input.len();
34311 let mut payload_buf = [0; Self::ENCODED_LEN];
34312 let mut buf = if avail_len < Self::ENCODED_LEN {
34313 payload_buf[0..avail_len].copy_from_slice(__input);
34314 Bytes::new(&payload_buf)
34315 } else {
34316 Bytes::new(__input)
34317 };
34318 let mut __struct = Self::default();
34319 __struct.request_id = buf.get_u8();
34320 __struct.uri_type = buf.get_u8();
34321 for v in &mut __struct.uri {
34322 let val = buf.get_u8();
34323 *v = val;
34324 }
34325 __struct.transfer_type = buf.get_u8();
34326 for v in &mut __struct.storage {
34327 let val = buf.get_u8();
34328 *v = val;
34329 }
34330 Ok(__struct)
34331 }
34332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34333 let mut __tmp = BytesMut::new(bytes);
34334 #[allow(clippy::absurd_extreme_comparisons)]
34335 #[allow(unused_comparisons)]
34336 if __tmp.remaining() < Self::ENCODED_LEN {
34337 panic!(
34338 "buffer is too small (need {} bytes, but got {})",
34339 Self::ENCODED_LEN,
34340 __tmp.remaining(),
34341 )
34342 }
34343 __tmp.put_u8(self.request_id);
34344 __tmp.put_u8(self.uri_type);
34345 for val in &self.uri {
34346 __tmp.put_u8(*val);
34347 }
34348 __tmp.put_u8(self.transfer_type);
34349 for val in &self.storage {
34350 __tmp.put_u8(*val);
34351 }
34352 if matches!(version, MavlinkVersion::V2) {
34353 let len = __tmp.len();
34354 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34355 } else {
34356 __tmp.len()
34357 }
34358 }
34359}
34360#[doc = "id: 413"]
34361#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
34362#[derive(Debug, Clone, PartialEq)]
34363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34364#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34365pub struct RESPONSE_EVENT_ERROR_DATA {
34366 #[doc = "Sequence number."]
34367 pub sequence: u16,
34368 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
34369 pub sequence_oldest_available: u16,
34370 #[doc = "System ID"]
34371 pub target_system: u8,
34372 #[doc = "Component ID"]
34373 pub target_component: u8,
34374 #[doc = "Error reason."]
34375 pub reason: MavEventErrorReason,
34376}
34377impl RESPONSE_EVENT_ERROR_DATA {
34378 pub const ENCODED_LEN: usize = 7usize;
34379 pub const DEFAULT: Self = Self {
34380 sequence: 0_u16,
34381 sequence_oldest_available: 0_u16,
34382 target_system: 0_u8,
34383 target_component: 0_u8,
34384 reason: MavEventErrorReason::DEFAULT,
34385 };
34386 #[cfg(feature = "arbitrary")]
34387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34388 use arbitrary::{Arbitrary, Unstructured};
34389 let mut buf = [0u8; 1024];
34390 rng.fill_bytes(&mut buf);
34391 let mut unstructured = Unstructured::new(&buf);
34392 Self::arbitrary(&mut unstructured).unwrap_or_default()
34393 }
34394}
34395impl Default for RESPONSE_EVENT_ERROR_DATA {
34396 fn default() -> Self {
34397 Self::DEFAULT.clone()
34398 }
34399}
34400impl MessageData for RESPONSE_EVENT_ERROR_DATA {
34401 type Message = MavMessage;
34402 const ID: u32 = 413u32;
34403 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
34404 const EXTRA_CRC: u8 = 77u8;
34405 const ENCODED_LEN: usize = 7usize;
34406 fn deser(
34407 _version: MavlinkVersion,
34408 __input: &[u8],
34409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34410 let avail_len = __input.len();
34411 let mut payload_buf = [0; Self::ENCODED_LEN];
34412 let mut buf = if avail_len < Self::ENCODED_LEN {
34413 payload_buf[0..avail_len].copy_from_slice(__input);
34414 Bytes::new(&payload_buf)
34415 } else {
34416 Bytes::new(__input)
34417 };
34418 let mut __struct = Self::default();
34419 __struct.sequence = buf.get_u16_le();
34420 __struct.sequence_oldest_available = buf.get_u16_le();
34421 __struct.target_system = buf.get_u8();
34422 __struct.target_component = buf.get_u8();
34423 let tmp = buf.get_u8();
34424 __struct.reason =
34425 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34426 enum_type: "MavEventErrorReason",
34427 value: tmp as u32,
34428 })?;
34429 Ok(__struct)
34430 }
34431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34432 let mut __tmp = BytesMut::new(bytes);
34433 #[allow(clippy::absurd_extreme_comparisons)]
34434 #[allow(unused_comparisons)]
34435 if __tmp.remaining() < Self::ENCODED_LEN {
34436 panic!(
34437 "buffer is too small (need {} bytes, but got {})",
34438 Self::ENCODED_LEN,
34439 __tmp.remaining(),
34440 )
34441 }
34442 __tmp.put_u16_le(self.sequence);
34443 __tmp.put_u16_le(self.sequence_oldest_available);
34444 __tmp.put_u8(self.target_system);
34445 __tmp.put_u8(self.target_component);
34446 __tmp.put_u8(self.reason as u8);
34447 if matches!(version, MavlinkVersion::V2) {
34448 let len = __tmp.len();
34449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34450 } else {
34451 __tmp.len()
34452 }
34453 }
34454}
34455#[doc = "id: 226"]
34456#[doc = "RPM sensor output."]
34457#[derive(Debug, Clone, PartialEq)]
34458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34460pub struct RPM_DATA {
34461 #[doc = "RPM Sensor1."]
34462 pub rpm1: f32,
34463 #[doc = "RPM Sensor2."]
34464 pub rpm2: f32,
34465}
34466impl RPM_DATA {
34467 pub const ENCODED_LEN: usize = 8usize;
34468 pub const DEFAULT: Self = Self {
34469 rpm1: 0.0_f32,
34470 rpm2: 0.0_f32,
34471 };
34472 #[cfg(feature = "arbitrary")]
34473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34474 use arbitrary::{Arbitrary, Unstructured};
34475 let mut buf = [0u8; 1024];
34476 rng.fill_bytes(&mut buf);
34477 let mut unstructured = Unstructured::new(&buf);
34478 Self::arbitrary(&mut unstructured).unwrap_or_default()
34479 }
34480}
34481impl Default for RPM_DATA {
34482 fn default() -> Self {
34483 Self::DEFAULT.clone()
34484 }
34485}
34486impl MessageData for RPM_DATA {
34487 type Message = MavMessage;
34488 const ID: u32 = 226u32;
34489 const NAME: &'static str = "RPM";
34490 const EXTRA_CRC: u8 = 207u8;
34491 const ENCODED_LEN: usize = 8usize;
34492 fn deser(
34493 _version: MavlinkVersion,
34494 __input: &[u8],
34495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34496 let avail_len = __input.len();
34497 let mut payload_buf = [0; Self::ENCODED_LEN];
34498 let mut buf = if avail_len < Self::ENCODED_LEN {
34499 payload_buf[0..avail_len].copy_from_slice(__input);
34500 Bytes::new(&payload_buf)
34501 } else {
34502 Bytes::new(__input)
34503 };
34504 let mut __struct = Self::default();
34505 __struct.rpm1 = buf.get_f32_le();
34506 __struct.rpm2 = buf.get_f32_le();
34507 Ok(__struct)
34508 }
34509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34510 let mut __tmp = BytesMut::new(bytes);
34511 #[allow(clippy::absurd_extreme_comparisons)]
34512 #[allow(unused_comparisons)]
34513 if __tmp.remaining() < Self::ENCODED_LEN {
34514 panic!(
34515 "buffer is too small (need {} bytes, but got {})",
34516 Self::ENCODED_LEN,
34517 __tmp.remaining(),
34518 )
34519 }
34520 __tmp.put_f32_le(self.rpm1);
34521 __tmp.put_f32_le(self.rpm2);
34522 if matches!(version, MavlinkVersion::V2) {
34523 let len = __tmp.len();
34524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34525 } else {
34526 __tmp.len()
34527 }
34528 }
34529}
34530#[doc = "id: 55"]
34531#[doc = "Read out the safety zone the MAV currently assumes."]
34532#[derive(Debug, Clone, PartialEq)]
34533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34535pub struct SAFETY_ALLOWED_AREA_DATA {
34536 #[doc = "x position 1 / Latitude 1"]
34537 pub p1x: f32,
34538 #[doc = "y position 1 / Longitude 1"]
34539 pub p1y: f32,
34540 #[doc = "z position 1 / Altitude 1"]
34541 pub p1z: f32,
34542 #[doc = "x position 2 / Latitude 2"]
34543 pub p2x: f32,
34544 #[doc = "y position 2 / Longitude 2"]
34545 pub p2y: f32,
34546 #[doc = "z position 2 / Altitude 2"]
34547 pub p2z: f32,
34548 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
34549 pub frame: MavFrame,
34550}
34551impl SAFETY_ALLOWED_AREA_DATA {
34552 pub const ENCODED_LEN: usize = 25usize;
34553 pub const DEFAULT: Self = Self {
34554 p1x: 0.0_f32,
34555 p1y: 0.0_f32,
34556 p1z: 0.0_f32,
34557 p2x: 0.0_f32,
34558 p2y: 0.0_f32,
34559 p2z: 0.0_f32,
34560 frame: MavFrame::DEFAULT,
34561 };
34562 #[cfg(feature = "arbitrary")]
34563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34564 use arbitrary::{Arbitrary, Unstructured};
34565 let mut buf = [0u8; 1024];
34566 rng.fill_bytes(&mut buf);
34567 let mut unstructured = Unstructured::new(&buf);
34568 Self::arbitrary(&mut unstructured).unwrap_or_default()
34569 }
34570}
34571impl Default for SAFETY_ALLOWED_AREA_DATA {
34572 fn default() -> Self {
34573 Self::DEFAULT.clone()
34574 }
34575}
34576impl MessageData for SAFETY_ALLOWED_AREA_DATA {
34577 type Message = MavMessage;
34578 const ID: u32 = 55u32;
34579 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
34580 const EXTRA_CRC: u8 = 3u8;
34581 const ENCODED_LEN: usize = 25usize;
34582 fn deser(
34583 _version: MavlinkVersion,
34584 __input: &[u8],
34585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34586 let avail_len = __input.len();
34587 let mut payload_buf = [0; Self::ENCODED_LEN];
34588 let mut buf = if avail_len < Self::ENCODED_LEN {
34589 payload_buf[0..avail_len].copy_from_slice(__input);
34590 Bytes::new(&payload_buf)
34591 } else {
34592 Bytes::new(__input)
34593 };
34594 let mut __struct = Self::default();
34595 __struct.p1x = buf.get_f32_le();
34596 __struct.p1y = buf.get_f32_le();
34597 __struct.p1z = buf.get_f32_le();
34598 __struct.p2x = buf.get_f32_le();
34599 __struct.p2y = buf.get_f32_le();
34600 __struct.p2z = buf.get_f32_le();
34601 let tmp = buf.get_u8();
34602 __struct.frame =
34603 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34604 enum_type: "MavFrame",
34605 value: tmp as u32,
34606 })?;
34607 Ok(__struct)
34608 }
34609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34610 let mut __tmp = BytesMut::new(bytes);
34611 #[allow(clippy::absurd_extreme_comparisons)]
34612 #[allow(unused_comparisons)]
34613 if __tmp.remaining() < Self::ENCODED_LEN {
34614 panic!(
34615 "buffer is too small (need {} bytes, but got {})",
34616 Self::ENCODED_LEN,
34617 __tmp.remaining(),
34618 )
34619 }
34620 __tmp.put_f32_le(self.p1x);
34621 __tmp.put_f32_le(self.p1y);
34622 __tmp.put_f32_le(self.p1z);
34623 __tmp.put_f32_le(self.p2x);
34624 __tmp.put_f32_le(self.p2y);
34625 __tmp.put_f32_le(self.p2z);
34626 __tmp.put_u8(self.frame as u8);
34627 if matches!(version, MavlinkVersion::V2) {
34628 let len = __tmp.len();
34629 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34630 } else {
34631 __tmp.len()
34632 }
34633 }
34634}
34635#[doc = "id: 54"]
34636#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
34637#[derive(Debug, Clone, PartialEq)]
34638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34640pub struct SAFETY_SET_ALLOWED_AREA_DATA {
34641 #[doc = "x position 1 / Latitude 1"]
34642 pub p1x: f32,
34643 #[doc = "y position 1 / Longitude 1"]
34644 pub p1y: f32,
34645 #[doc = "z position 1 / Altitude 1"]
34646 pub p1z: f32,
34647 #[doc = "x position 2 / Latitude 2"]
34648 pub p2x: f32,
34649 #[doc = "y position 2 / Longitude 2"]
34650 pub p2y: f32,
34651 #[doc = "z position 2 / Altitude 2"]
34652 pub p2z: f32,
34653 #[doc = "System ID"]
34654 pub target_system: u8,
34655 #[doc = "Component ID"]
34656 pub target_component: u8,
34657 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
34658 pub frame: MavFrame,
34659}
34660impl SAFETY_SET_ALLOWED_AREA_DATA {
34661 pub const ENCODED_LEN: usize = 27usize;
34662 pub const DEFAULT: Self = Self {
34663 p1x: 0.0_f32,
34664 p1y: 0.0_f32,
34665 p1z: 0.0_f32,
34666 p2x: 0.0_f32,
34667 p2y: 0.0_f32,
34668 p2z: 0.0_f32,
34669 target_system: 0_u8,
34670 target_component: 0_u8,
34671 frame: MavFrame::DEFAULT,
34672 };
34673 #[cfg(feature = "arbitrary")]
34674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34675 use arbitrary::{Arbitrary, Unstructured};
34676 let mut buf = [0u8; 1024];
34677 rng.fill_bytes(&mut buf);
34678 let mut unstructured = Unstructured::new(&buf);
34679 Self::arbitrary(&mut unstructured).unwrap_or_default()
34680 }
34681}
34682impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
34683 fn default() -> Self {
34684 Self::DEFAULT.clone()
34685 }
34686}
34687impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
34688 type Message = MavMessage;
34689 const ID: u32 = 54u32;
34690 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
34691 const EXTRA_CRC: u8 = 15u8;
34692 const ENCODED_LEN: usize = 27usize;
34693 fn deser(
34694 _version: MavlinkVersion,
34695 __input: &[u8],
34696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34697 let avail_len = __input.len();
34698 let mut payload_buf = [0; Self::ENCODED_LEN];
34699 let mut buf = if avail_len < Self::ENCODED_LEN {
34700 payload_buf[0..avail_len].copy_from_slice(__input);
34701 Bytes::new(&payload_buf)
34702 } else {
34703 Bytes::new(__input)
34704 };
34705 let mut __struct = Self::default();
34706 __struct.p1x = buf.get_f32_le();
34707 __struct.p1y = buf.get_f32_le();
34708 __struct.p1z = buf.get_f32_le();
34709 __struct.p2x = buf.get_f32_le();
34710 __struct.p2y = buf.get_f32_le();
34711 __struct.p2z = buf.get_f32_le();
34712 __struct.target_system = buf.get_u8();
34713 __struct.target_component = buf.get_u8();
34714 let tmp = buf.get_u8();
34715 __struct.frame =
34716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
34717 enum_type: "MavFrame",
34718 value: tmp as u32,
34719 })?;
34720 Ok(__struct)
34721 }
34722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34723 let mut __tmp = BytesMut::new(bytes);
34724 #[allow(clippy::absurd_extreme_comparisons)]
34725 #[allow(unused_comparisons)]
34726 if __tmp.remaining() < Self::ENCODED_LEN {
34727 panic!(
34728 "buffer is too small (need {} bytes, but got {})",
34729 Self::ENCODED_LEN,
34730 __tmp.remaining(),
34731 )
34732 }
34733 __tmp.put_f32_le(self.p1x);
34734 __tmp.put_f32_le(self.p1y);
34735 __tmp.put_f32_le(self.p1z);
34736 __tmp.put_f32_le(self.p2x);
34737 __tmp.put_f32_le(self.p2y);
34738 __tmp.put_f32_le(self.p2z);
34739 __tmp.put_u8(self.target_system);
34740 __tmp.put_u8(self.target_component);
34741 __tmp.put_u8(self.frame as u8);
34742 if matches!(version, MavlinkVersion::V2) {
34743 let len = __tmp.len();
34744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34745 } else {
34746 __tmp.len()
34747 }
34748 }
34749}
34750#[doc = "id: 26"]
34751#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
34752#[derive(Debug, Clone, PartialEq)]
34753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34755pub struct SCALED_IMU_DATA {
34756 #[doc = "Timestamp (time since system boot)."]
34757 pub time_boot_ms: u32,
34758 #[doc = "X acceleration"]
34759 pub xacc: i16,
34760 #[doc = "Y acceleration"]
34761 pub yacc: i16,
34762 #[doc = "Z acceleration"]
34763 pub zacc: i16,
34764 #[doc = "Angular speed around X axis"]
34765 pub xgyro: i16,
34766 #[doc = "Angular speed around Y axis"]
34767 pub ygyro: i16,
34768 #[doc = "Angular speed around Z axis"]
34769 pub zgyro: i16,
34770 #[doc = "X Magnetic field"]
34771 pub xmag: i16,
34772 #[doc = "Y Magnetic field"]
34773 pub ymag: i16,
34774 #[doc = "Z Magnetic field"]
34775 pub zmag: i16,
34776 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
34777 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34778 pub temperature: i16,
34779}
34780impl SCALED_IMU_DATA {
34781 pub const ENCODED_LEN: usize = 24usize;
34782 pub const DEFAULT: Self = Self {
34783 time_boot_ms: 0_u32,
34784 xacc: 0_i16,
34785 yacc: 0_i16,
34786 zacc: 0_i16,
34787 xgyro: 0_i16,
34788 ygyro: 0_i16,
34789 zgyro: 0_i16,
34790 xmag: 0_i16,
34791 ymag: 0_i16,
34792 zmag: 0_i16,
34793 temperature: 0_i16,
34794 };
34795 #[cfg(feature = "arbitrary")]
34796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34797 use arbitrary::{Arbitrary, Unstructured};
34798 let mut buf = [0u8; 1024];
34799 rng.fill_bytes(&mut buf);
34800 let mut unstructured = Unstructured::new(&buf);
34801 Self::arbitrary(&mut unstructured).unwrap_or_default()
34802 }
34803}
34804impl Default for SCALED_IMU_DATA {
34805 fn default() -> Self {
34806 Self::DEFAULT.clone()
34807 }
34808}
34809impl MessageData for SCALED_IMU_DATA {
34810 type Message = MavMessage;
34811 const ID: u32 = 26u32;
34812 const NAME: &'static str = "SCALED_IMU";
34813 const EXTRA_CRC: u8 = 170u8;
34814 const ENCODED_LEN: usize = 24usize;
34815 fn deser(
34816 _version: MavlinkVersion,
34817 __input: &[u8],
34818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34819 let avail_len = __input.len();
34820 let mut payload_buf = [0; Self::ENCODED_LEN];
34821 let mut buf = if avail_len < Self::ENCODED_LEN {
34822 payload_buf[0..avail_len].copy_from_slice(__input);
34823 Bytes::new(&payload_buf)
34824 } else {
34825 Bytes::new(__input)
34826 };
34827 let mut __struct = Self::default();
34828 __struct.time_boot_ms = buf.get_u32_le();
34829 __struct.xacc = buf.get_i16_le();
34830 __struct.yacc = buf.get_i16_le();
34831 __struct.zacc = buf.get_i16_le();
34832 __struct.xgyro = buf.get_i16_le();
34833 __struct.ygyro = buf.get_i16_le();
34834 __struct.zgyro = buf.get_i16_le();
34835 __struct.xmag = buf.get_i16_le();
34836 __struct.ymag = buf.get_i16_le();
34837 __struct.zmag = buf.get_i16_le();
34838 __struct.temperature = buf.get_i16_le();
34839 Ok(__struct)
34840 }
34841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34842 let mut __tmp = BytesMut::new(bytes);
34843 #[allow(clippy::absurd_extreme_comparisons)]
34844 #[allow(unused_comparisons)]
34845 if __tmp.remaining() < Self::ENCODED_LEN {
34846 panic!(
34847 "buffer is too small (need {} bytes, but got {})",
34848 Self::ENCODED_LEN,
34849 __tmp.remaining(),
34850 )
34851 }
34852 __tmp.put_u32_le(self.time_boot_ms);
34853 __tmp.put_i16_le(self.xacc);
34854 __tmp.put_i16_le(self.yacc);
34855 __tmp.put_i16_le(self.zacc);
34856 __tmp.put_i16_le(self.xgyro);
34857 __tmp.put_i16_le(self.ygyro);
34858 __tmp.put_i16_le(self.zgyro);
34859 __tmp.put_i16_le(self.xmag);
34860 __tmp.put_i16_le(self.ymag);
34861 __tmp.put_i16_le(self.zmag);
34862 __tmp.put_i16_le(self.temperature);
34863 if matches!(version, MavlinkVersion::V2) {
34864 let len = __tmp.len();
34865 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34866 } else {
34867 __tmp.len()
34868 }
34869 }
34870}
34871#[doc = "id: 116"]
34872#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
34873#[derive(Debug, Clone, PartialEq)]
34874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34876pub struct SCALED_IMU2_DATA {
34877 #[doc = "Timestamp (time since system boot)."]
34878 pub time_boot_ms: u32,
34879 #[doc = "X acceleration"]
34880 pub xacc: i16,
34881 #[doc = "Y acceleration"]
34882 pub yacc: i16,
34883 #[doc = "Z acceleration"]
34884 pub zacc: i16,
34885 #[doc = "Angular speed around X axis"]
34886 pub xgyro: i16,
34887 #[doc = "Angular speed around Y axis"]
34888 pub ygyro: i16,
34889 #[doc = "Angular speed around Z axis"]
34890 pub zgyro: i16,
34891 #[doc = "X Magnetic field"]
34892 pub xmag: i16,
34893 #[doc = "Y Magnetic field"]
34894 pub ymag: i16,
34895 #[doc = "Z Magnetic field"]
34896 pub zmag: i16,
34897 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
34898 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
34899 pub temperature: i16,
34900}
34901impl SCALED_IMU2_DATA {
34902 pub const ENCODED_LEN: usize = 24usize;
34903 pub const DEFAULT: Self = Self {
34904 time_boot_ms: 0_u32,
34905 xacc: 0_i16,
34906 yacc: 0_i16,
34907 zacc: 0_i16,
34908 xgyro: 0_i16,
34909 ygyro: 0_i16,
34910 zgyro: 0_i16,
34911 xmag: 0_i16,
34912 ymag: 0_i16,
34913 zmag: 0_i16,
34914 temperature: 0_i16,
34915 };
34916 #[cfg(feature = "arbitrary")]
34917 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
34918 use arbitrary::{Arbitrary, Unstructured};
34919 let mut buf = [0u8; 1024];
34920 rng.fill_bytes(&mut buf);
34921 let mut unstructured = Unstructured::new(&buf);
34922 Self::arbitrary(&mut unstructured).unwrap_or_default()
34923 }
34924}
34925impl Default for SCALED_IMU2_DATA {
34926 fn default() -> Self {
34927 Self::DEFAULT.clone()
34928 }
34929}
34930impl MessageData for SCALED_IMU2_DATA {
34931 type Message = MavMessage;
34932 const ID: u32 = 116u32;
34933 const NAME: &'static str = "SCALED_IMU2";
34934 const EXTRA_CRC: u8 = 76u8;
34935 const ENCODED_LEN: usize = 24usize;
34936 fn deser(
34937 _version: MavlinkVersion,
34938 __input: &[u8],
34939 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34940 let avail_len = __input.len();
34941 let mut payload_buf = [0; Self::ENCODED_LEN];
34942 let mut buf = if avail_len < Self::ENCODED_LEN {
34943 payload_buf[0..avail_len].copy_from_slice(__input);
34944 Bytes::new(&payload_buf)
34945 } else {
34946 Bytes::new(__input)
34947 };
34948 let mut __struct = Self::default();
34949 __struct.time_boot_ms = buf.get_u32_le();
34950 __struct.xacc = buf.get_i16_le();
34951 __struct.yacc = buf.get_i16_le();
34952 __struct.zacc = buf.get_i16_le();
34953 __struct.xgyro = buf.get_i16_le();
34954 __struct.ygyro = buf.get_i16_le();
34955 __struct.zgyro = buf.get_i16_le();
34956 __struct.xmag = buf.get_i16_le();
34957 __struct.ymag = buf.get_i16_le();
34958 __struct.zmag = buf.get_i16_le();
34959 __struct.temperature = buf.get_i16_le();
34960 Ok(__struct)
34961 }
34962 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34963 let mut __tmp = BytesMut::new(bytes);
34964 #[allow(clippy::absurd_extreme_comparisons)]
34965 #[allow(unused_comparisons)]
34966 if __tmp.remaining() < Self::ENCODED_LEN {
34967 panic!(
34968 "buffer is too small (need {} bytes, but got {})",
34969 Self::ENCODED_LEN,
34970 __tmp.remaining(),
34971 )
34972 }
34973 __tmp.put_u32_le(self.time_boot_ms);
34974 __tmp.put_i16_le(self.xacc);
34975 __tmp.put_i16_le(self.yacc);
34976 __tmp.put_i16_le(self.zacc);
34977 __tmp.put_i16_le(self.xgyro);
34978 __tmp.put_i16_le(self.ygyro);
34979 __tmp.put_i16_le(self.zgyro);
34980 __tmp.put_i16_le(self.xmag);
34981 __tmp.put_i16_le(self.ymag);
34982 __tmp.put_i16_le(self.zmag);
34983 __tmp.put_i16_le(self.temperature);
34984 if matches!(version, MavlinkVersion::V2) {
34985 let len = __tmp.len();
34986 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
34987 } else {
34988 __tmp.len()
34989 }
34990 }
34991}
34992#[doc = "id: 129"]
34993#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
34994#[derive(Debug, Clone, PartialEq)]
34995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
34997pub struct SCALED_IMU3_DATA {
34998 #[doc = "Timestamp (time since system boot)."]
34999 pub time_boot_ms: u32,
35000 #[doc = "X acceleration"]
35001 pub xacc: i16,
35002 #[doc = "Y acceleration"]
35003 pub yacc: i16,
35004 #[doc = "Z acceleration"]
35005 pub zacc: i16,
35006 #[doc = "Angular speed around X axis"]
35007 pub xgyro: i16,
35008 #[doc = "Angular speed around Y axis"]
35009 pub ygyro: i16,
35010 #[doc = "Angular speed around Z axis"]
35011 pub zgyro: i16,
35012 #[doc = "X Magnetic field"]
35013 pub xmag: i16,
35014 #[doc = "Y Magnetic field"]
35015 pub ymag: i16,
35016 #[doc = "Z Magnetic field"]
35017 pub zmag: i16,
35018 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
35019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35020 pub temperature: i16,
35021}
35022impl SCALED_IMU3_DATA {
35023 pub const ENCODED_LEN: usize = 24usize;
35024 pub const DEFAULT: Self = Self {
35025 time_boot_ms: 0_u32,
35026 xacc: 0_i16,
35027 yacc: 0_i16,
35028 zacc: 0_i16,
35029 xgyro: 0_i16,
35030 ygyro: 0_i16,
35031 zgyro: 0_i16,
35032 xmag: 0_i16,
35033 ymag: 0_i16,
35034 zmag: 0_i16,
35035 temperature: 0_i16,
35036 };
35037 #[cfg(feature = "arbitrary")]
35038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35039 use arbitrary::{Arbitrary, Unstructured};
35040 let mut buf = [0u8; 1024];
35041 rng.fill_bytes(&mut buf);
35042 let mut unstructured = Unstructured::new(&buf);
35043 Self::arbitrary(&mut unstructured).unwrap_or_default()
35044 }
35045}
35046impl Default for SCALED_IMU3_DATA {
35047 fn default() -> Self {
35048 Self::DEFAULT.clone()
35049 }
35050}
35051impl MessageData for SCALED_IMU3_DATA {
35052 type Message = MavMessage;
35053 const ID: u32 = 129u32;
35054 const NAME: &'static str = "SCALED_IMU3";
35055 const EXTRA_CRC: u8 = 46u8;
35056 const ENCODED_LEN: usize = 24usize;
35057 fn deser(
35058 _version: MavlinkVersion,
35059 __input: &[u8],
35060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35061 let avail_len = __input.len();
35062 let mut payload_buf = [0; Self::ENCODED_LEN];
35063 let mut buf = if avail_len < Self::ENCODED_LEN {
35064 payload_buf[0..avail_len].copy_from_slice(__input);
35065 Bytes::new(&payload_buf)
35066 } else {
35067 Bytes::new(__input)
35068 };
35069 let mut __struct = Self::default();
35070 __struct.time_boot_ms = buf.get_u32_le();
35071 __struct.xacc = buf.get_i16_le();
35072 __struct.yacc = buf.get_i16_le();
35073 __struct.zacc = buf.get_i16_le();
35074 __struct.xgyro = buf.get_i16_le();
35075 __struct.ygyro = buf.get_i16_le();
35076 __struct.zgyro = buf.get_i16_le();
35077 __struct.xmag = buf.get_i16_le();
35078 __struct.ymag = buf.get_i16_le();
35079 __struct.zmag = buf.get_i16_le();
35080 __struct.temperature = buf.get_i16_le();
35081 Ok(__struct)
35082 }
35083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35084 let mut __tmp = BytesMut::new(bytes);
35085 #[allow(clippy::absurd_extreme_comparisons)]
35086 #[allow(unused_comparisons)]
35087 if __tmp.remaining() < Self::ENCODED_LEN {
35088 panic!(
35089 "buffer is too small (need {} bytes, but got {})",
35090 Self::ENCODED_LEN,
35091 __tmp.remaining(),
35092 )
35093 }
35094 __tmp.put_u32_le(self.time_boot_ms);
35095 __tmp.put_i16_le(self.xacc);
35096 __tmp.put_i16_le(self.yacc);
35097 __tmp.put_i16_le(self.zacc);
35098 __tmp.put_i16_le(self.xgyro);
35099 __tmp.put_i16_le(self.ygyro);
35100 __tmp.put_i16_le(self.zgyro);
35101 __tmp.put_i16_le(self.xmag);
35102 __tmp.put_i16_le(self.ymag);
35103 __tmp.put_i16_le(self.zmag);
35104 __tmp.put_i16_le(self.temperature);
35105 if matches!(version, MavlinkVersion::V2) {
35106 let len = __tmp.len();
35107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35108 } else {
35109 __tmp.len()
35110 }
35111 }
35112}
35113#[doc = "id: 29"]
35114#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
35115#[derive(Debug, Clone, PartialEq)]
35116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35118pub struct SCALED_PRESSURE_DATA {
35119 #[doc = "Timestamp (time since system boot)."]
35120 pub time_boot_ms: u32,
35121 #[doc = "Absolute pressure"]
35122 pub press_abs: f32,
35123 #[doc = "Differential pressure 1"]
35124 pub press_diff: f32,
35125 #[doc = "Absolute pressure temperature"]
35126 pub temperature: i16,
35127 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
35128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35129 pub temperature_press_diff: i16,
35130}
35131impl SCALED_PRESSURE_DATA {
35132 pub const ENCODED_LEN: usize = 16usize;
35133 pub const DEFAULT: Self = Self {
35134 time_boot_ms: 0_u32,
35135 press_abs: 0.0_f32,
35136 press_diff: 0.0_f32,
35137 temperature: 0_i16,
35138 temperature_press_diff: 0_i16,
35139 };
35140 #[cfg(feature = "arbitrary")]
35141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35142 use arbitrary::{Arbitrary, Unstructured};
35143 let mut buf = [0u8; 1024];
35144 rng.fill_bytes(&mut buf);
35145 let mut unstructured = Unstructured::new(&buf);
35146 Self::arbitrary(&mut unstructured).unwrap_or_default()
35147 }
35148}
35149impl Default for SCALED_PRESSURE_DATA {
35150 fn default() -> Self {
35151 Self::DEFAULT.clone()
35152 }
35153}
35154impl MessageData for SCALED_PRESSURE_DATA {
35155 type Message = MavMessage;
35156 const ID: u32 = 29u32;
35157 const NAME: &'static str = "SCALED_PRESSURE";
35158 const EXTRA_CRC: u8 = 115u8;
35159 const ENCODED_LEN: usize = 16usize;
35160 fn deser(
35161 _version: MavlinkVersion,
35162 __input: &[u8],
35163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35164 let avail_len = __input.len();
35165 let mut payload_buf = [0; Self::ENCODED_LEN];
35166 let mut buf = if avail_len < Self::ENCODED_LEN {
35167 payload_buf[0..avail_len].copy_from_slice(__input);
35168 Bytes::new(&payload_buf)
35169 } else {
35170 Bytes::new(__input)
35171 };
35172 let mut __struct = Self::default();
35173 __struct.time_boot_ms = buf.get_u32_le();
35174 __struct.press_abs = buf.get_f32_le();
35175 __struct.press_diff = buf.get_f32_le();
35176 __struct.temperature = buf.get_i16_le();
35177 __struct.temperature_press_diff = buf.get_i16_le();
35178 Ok(__struct)
35179 }
35180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35181 let mut __tmp = BytesMut::new(bytes);
35182 #[allow(clippy::absurd_extreme_comparisons)]
35183 #[allow(unused_comparisons)]
35184 if __tmp.remaining() < Self::ENCODED_LEN {
35185 panic!(
35186 "buffer is too small (need {} bytes, but got {})",
35187 Self::ENCODED_LEN,
35188 __tmp.remaining(),
35189 )
35190 }
35191 __tmp.put_u32_le(self.time_boot_ms);
35192 __tmp.put_f32_le(self.press_abs);
35193 __tmp.put_f32_le(self.press_diff);
35194 __tmp.put_i16_le(self.temperature);
35195 __tmp.put_i16_le(self.temperature_press_diff);
35196 if matches!(version, MavlinkVersion::V2) {
35197 let len = __tmp.len();
35198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35199 } else {
35200 __tmp.len()
35201 }
35202 }
35203}
35204#[doc = "id: 137"]
35205#[doc = "Barometer readings for 2nd barometer."]
35206#[derive(Debug, Clone, PartialEq)]
35207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35209pub struct SCALED_PRESSURE2_DATA {
35210 #[doc = "Timestamp (time since system boot)."]
35211 pub time_boot_ms: u32,
35212 #[doc = "Absolute pressure"]
35213 pub press_abs: f32,
35214 #[doc = "Differential pressure"]
35215 pub press_diff: f32,
35216 #[doc = "Absolute pressure temperature"]
35217 pub temperature: i16,
35218 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
35219 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35220 pub temperature_press_diff: i16,
35221}
35222impl SCALED_PRESSURE2_DATA {
35223 pub const ENCODED_LEN: usize = 16usize;
35224 pub const DEFAULT: Self = Self {
35225 time_boot_ms: 0_u32,
35226 press_abs: 0.0_f32,
35227 press_diff: 0.0_f32,
35228 temperature: 0_i16,
35229 temperature_press_diff: 0_i16,
35230 };
35231 #[cfg(feature = "arbitrary")]
35232 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35233 use arbitrary::{Arbitrary, Unstructured};
35234 let mut buf = [0u8; 1024];
35235 rng.fill_bytes(&mut buf);
35236 let mut unstructured = Unstructured::new(&buf);
35237 Self::arbitrary(&mut unstructured).unwrap_or_default()
35238 }
35239}
35240impl Default for SCALED_PRESSURE2_DATA {
35241 fn default() -> Self {
35242 Self::DEFAULT.clone()
35243 }
35244}
35245impl MessageData for SCALED_PRESSURE2_DATA {
35246 type Message = MavMessage;
35247 const ID: u32 = 137u32;
35248 const NAME: &'static str = "SCALED_PRESSURE2";
35249 const EXTRA_CRC: u8 = 195u8;
35250 const ENCODED_LEN: usize = 16usize;
35251 fn deser(
35252 _version: MavlinkVersion,
35253 __input: &[u8],
35254 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35255 let avail_len = __input.len();
35256 let mut payload_buf = [0; Self::ENCODED_LEN];
35257 let mut buf = if avail_len < Self::ENCODED_LEN {
35258 payload_buf[0..avail_len].copy_from_slice(__input);
35259 Bytes::new(&payload_buf)
35260 } else {
35261 Bytes::new(__input)
35262 };
35263 let mut __struct = Self::default();
35264 __struct.time_boot_ms = buf.get_u32_le();
35265 __struct.press_abs = buf.get_f32_le();
35266 __struct.press_diff = buf.get_f32_le();
35267 __struct.temperature = buf.get_i16_le();
35268 __struct.temperature_press_diff = buf.get_i16_le();
35269 Ok(__struct)
35270 }
35271 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35272 let mut __tmp = BytesMut::new(bytes);
35273 #[allow(clippy::absurd_extreme_comparisons)]
35274 #[allow(unused_comparisons)]
35275 if __tmp.remaining() < Self::ENCODED_LEN {
35276 panic!(
35277 "buffer is too small (need {} bytes, but got {})",
35278 Self::ENCODED_LEN,
35279 __tmp.remaining(),
35280 )
35281 }
35282 __tmp.put_u32_le(self.time_boot_ms);
35283 __tmp.put_f32_le(self.press_abs);
35284 __tmp.put_f32_le(self.press_diff);
35285 __tmp.put_i16_le(self.temperature);
35286 __tmp.put_i16_le(self.temperature_press_diff);
35287 if matches!(version, MavlinkVersion::V2) {
35288 let len = __tmp.len();
35289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35290 } else {
35291 __tmp.len()
35292 }
35293 }
35294}
35295#[doc = "id: 143"]
35296#[doc = "Barometer readings for 3rd barometer."]
35297#[derive(Debug, Clone, PartialEq)]
35298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35300pub struct SCALED_PRESSURE3_DATA {
35301 #[doc = "Timestamp (time since system boot)."]
35302 pub time_boot_ms: u32,
35303 #[doc = "Absolute pressure"]
35304 pub press_abs: f32,
35305 #[doc = "Differential pressure"]
35306 pub press_diff: f32,
35307 #[doc = "Absolute pressure temperature"]
35308 pub temperature: i16,
35309 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
35310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35311 pub temperature_press_diff: i16,
35312}
35313impl SCALED_PRESSURE3_DATA {
35314 pub const ENCODED_LEN: usize = 16usize;
35315 pub const DEFAULT: Self = Self {
35316 time_boot_ms: 0_u32,
35317 press_abs: 0.0_f32,
35318 press_diff: 0.0_f32,
35319 temperature: 0_i16,
35320 temperature_press_diff: 0_i16,
35321 };
35322 #[cfg(feature = "arbitrary")]
35323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35324 use arbitrary::{Arbitrary, Unstructured};
35325 let mut buf = [0u8; 1024];
35326 rng.fill_bytes(&mut buf);
35327 let mut unstructured = Unstructured::new(&buf);
35328 Self::arbitrary(&mut unstructured).unwrap_or_default()
35329 }
35330}
35331impl Default for SCALED_PRESSURE3_DATA {
35332 fn default() -> Self {
35333 Self::DEFAULT.clone()
35334 }
35335}
35336impl MessageData for SCALED_PRESSURE3_DATA {
35337 type Message = MavMessage;
35338 const ID: u32 = 143u32;
35339 const NAME: &'static str = "SCALED_PRESSURE3";
35340 const EXTRA_CRC: u8 = 131u8;
35341 const ENCODED_LEN: usize = 16usize;
35342 fn deser(
35343 _version: MavlinkVersion,
35344 __input: &[u8],
35345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35346 let avail_len = __input.len();
35347 let mut payload_buf = [0; Self::ENCODED_LEN];
35348 let mut buf = if avail_len < Self::ENCODED_LEN {
35349 payload_buf[0..avail_len].copy_from_slice(__input);
35350 Bytes::new(&payload_buf)
35351 } else {
35352 Bytes::new(__input)
35353 };
35354 let mut __struct = Self::default();
35355 __struct.time_boot_ms = buf.get_u32_le();
35356 __struct.press_abs = buf.get_f32_le();
35357 __struct.press_diff = buf.get_f32_le();
35358 __struct.temperature = buf.get_i16_le();
35359 __struct.temperature_press_diff = buf.get_i16_le();
35360 Ok(__struct)
35361 }
35362 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35363 let mut __tmp = BytesMut::new(bytes);
35364 #[allow(clippy::absurd_extreme_comparisons)]
35365 #[allow(unused_comparisons)]
35366 if __tmp.remaining() < Self::ENCODED_LEN {
35367 panic!(
35368 "buffer is too small (need {} bytes, but got {})",
35369 Self::ENCODED_LEN,
35370 __tmp.remaining(),
35371 )
35372 }
35373 __tmp.put_u32_le(self.time_boot_ms);
35374 __tmp.put_f32_le(self.press_abs);
35375 __tmp.put_f32_le(self.press_diff);
35376 __tmp.put_i16_le(self.temperature);
35377 __tmp.put_i16_le(self.temperature_press_diff);
35378 if matches!(version, MavlinkVersion::V2) {
35379 let len = __tmp.len();
35380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35381 } else {
35382 __tmp.len()
35383 }
35384 }
35385}
35386#[doc = "id: 11004"]
35387#[doc = "Send a secure command. Data should be signed with a private key corresponding with a public key known to the recipient. Signature should be over the concatenation of the sequence number (little-endian format), the operation (little-endian format) the data and the session key. For SECURE_COMMAND_GET_SESSION_KEY the session key should be zero length. The data array consists of the data followed by the signature. The sum of the data_length and the sig_length cannot be more than 220. The format of the data is command specific."]
35388#[derive(Debug, Clone, PartialEq)]
35389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35391pub struct SECURE_COMMAND_DATA {
35392 #[doc = "Sequence ID for tagging reply."]
35393 pub sequence: u32,
35394 #[doc = "Operation being requested."]
35395 pub operation: SecureCommandOp,
35396 #[doc = "System ID."]
35397 pub target_system: u8,
35398 #[doc = "Component ID."]
35399 pub target_component: u8,
35400 #[doc = "Data length."]
35401 pub data_length: u8,
35402 #[doc = "Signature length."]
35403 pub sig_length: u8,
35404 #[doc = "Signed data."]
35405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
35406 pub data: [u8; 220],
35407}
35408impl SECURE_COMMAND_DATA {
35409 pub const ENCODED_LEN: usize = 232usize;
35410 pub const DEFAULT: Self = Self {
35411 sequence: 0_u32,
35412 operation: SecureCommandOp::DEFAULT,
35413 target_system: 0_u8,
35414 target_component: 0_u8,
35415 data_length: 0_u8,
35416 sig_length: 0_u8,
35417 data: [0_u8; 220usize],
35418 };
35419 #[cfg(feature = "arbitrary")]
35420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35421 use arbitrary::{Arbitrary, Unstructured};
35422 let mut buf = [0u8; 1024];
35423 rng.fill_bytes(&mut buf);
35424 let mut unstructured = Unstructured::new(&buf);
35425 Self::arbitrary(&mut unstructured).unwrap_or_default()
35426 }
35427}
35428impl Default for SECURE_COMMAND_DATA {
35429 fn default() -> Self {
35430 Self::DEFAULT.clone()
35431 }
35432}
35433impl MessageData for SECURE_COMMAND_DATA {
35434 type Message = MavMessage;
35435 const ID: u32 = 11004u32;
35436 const NAME: &'static str = "SECURE_COMMAND";
35437 const EXTRA_CRC: u8 = 11u8;
35438 const ENCODED_LEN: usize = 232usize;
35439 fn deser(
35440 _version: MavlinkVersion,
35441 __input: &[u8],
35442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35443 let avail_len = __input.len();
35444 let mut payload_buf = [0; Self::ENCODED_LEN];
35445 let mut buf = if avail_len < Self::ENCODED_LEN {
35446 payload_buf[0..avail_len].copy_from_slice(__input);
35447 Bytes::new(&payload_buf)
35448 } else {
35449 Bytes::new(__input)
35450 };
35451 let mut __struct = Self::default();
35452 __struct.sequence = buf.get_u32_le();
35453 let tmp = buf.get_u32_le();
35454 __struct.operation = FromPrimitive::from_u32(tmp).ok_or(
35455 ::mavlink_core::error::ParserError::InvalidEnum {
35456 enum_type: "SecureCommandOp",
35457 value: tmp as u32,
35458 },
35459 )?;
35460 __struct.target_system = buf.get_u8();
35461 __struct.target_component = buf.get_u8();
35462 __struct.data_length = buf.get_u8();
35463 __struct.sig_length = buf.get_u8();
35464 for v in &mut __struct.data {
35465 let val = buf.get_u8();
35466 *v = val;
35467 }
35468 Ok(__struct)
35469 }
35470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35471 let mut __tmp = BytesMut::new(bytes);
35472 #[allow(clippy::absurd_extreme_comparisons)]
35473 #[allow(unused_comparisons)]
35474 if __tmp.remaining() < Self::ENCODED_LEN {
35475 panic!(
35476 "buffer is too small (need {} bytes, but got {})",
35477 Self::ENCODED_LEN,
35478 __tmp.remaining(),
35479 )
35480 }
35481 __tmp.put_u32_le(self.sequence);
35482 __tmp.put_u32_le(self.operation as u32);
35483 __tmp.put_u8(self.target_system);
35484 __tmp.put_u8(self.target_component);
35485 __tmp.put_u8(self.data_length);
35486 __tmp.put_u8(self.sig_length);
35487 for val in &self.data {
35488 __tmp.put_u8(*val);
35489 }
35490 if matches!(version, MavlinkVersion::V2) {
35491 let len = __tmp.len();
35492 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35493 } else {
35494 __tmp.len()
35495 }
35496 }
35497}
35498#[doc = "id: 11005"]
35499#[doc = "Reply from secure command."]
35500#[derive(Debug, Clone, PartialEq)]
35501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35503pub struct SECURE_COMMAND_REPLY_DATA {
35504 #[doc = "Sequence ID from request."]
35505 pub sequence: u32,
35506 #[doc = "Operation that was requested."]
35507 pub operation: SecureCommandOp,
35508 #[doc = "Result of command."]
35509 pub result: MavResult,
35510 #[doc = "Data length."]
35511 pub data_length: u8,
35512 #[doc = "Reply data."]
35513 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
35514 pub data: [u8; 220],
35515}
35516impl SECURE_COMMAND_REPLY_DATA {
35517 pub const ENCODED_LEN: usize = 230usize;
35518 pub const DEFAULT: Self = Self {
35519 sequence: 0_u32,
35520 operation: SecureCommandOp::DEFAULT,
35521 result: MavResult::DEFAULT,
35522 data_length: 0_u8,
35523 data: [0_u8; 220usize],
35524 };
35525 #[cfg(feature = "arbitrary")]
35526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35527 use arbitrary::{Arbitrary, Unstructured};
35528 let mut buf = [0u8; 1024];
35529 rng.fill_bytes(&mut buf);
35530 let mut unstructured = Unstructured::new(&buf);
35531 Self::arbitrary(&mut unstructured).unwrap_or_default()
35532 }
35533}
35534impl Default for SECURE_COMMAND_REPLY_DATA {
35535 fn default() -> Self {
35536 Self::DEFAULT.clone()
35537 }
35538}
35539impl MessageData for SECURE_COMMAND_REPLY_DATA {
35540 type Message = MavMessage;
35541 const ID: u32 = 11005u32;
35542 const NAME: &'static str = "SECURE_COMMAND_REPLY";
35543 const EXTRA_CRC: u8 = 93u8;
35544 const ENCODED_LEN: usize = 230usize;
35545 fn deser(
35546 _version: MavlinkVersion,
35547 __input: &[u8],
35548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35549 let avail_len = __input.len();
35550 let mut payload_buf = [0; Self::ENCODED_LEN];
35551 let mut buf = if avail_len < Self::ENCODED_LEN {
35552 payload_buf[0..avail_len].copy_from_slice(__input);
35553 Bytes::new(&payload_buf)
35554 } else {
35555 Bytes::new(__input)
35556 };
35557 let mut __struct = Self::default();
35558 __struct.sequence = buf.get_u32_le();
35559 let tmp = buf.get_u32_le();
35560 __struct.operation = FromPrimitive::from_u32(tmp).ok_or(
35561 ::mavlink_core::error::ParserError::InvalidEnum {
35562 enum_type: "SecureCommandOp",
35563 value: tmp as u32,
35564 },
35565 )?;
35566 let tmp = buf.get_u8();
35567 __struct.result =
35568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
35569 enum_type: "MavResult",
35570 value: tmp as u32,
35571 })?;
35572 __struct.data_length = buf.get_u8();
35573 for v in &mut __struct.data {
35574 let val = buf.get_u8();
35575 *v = val;
35576 }
35577 Ok(__struct)
35578 }
35579 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35580 let mut __tmp = BytesMut::new(bytes);
35581 #[allow(clippy::absurd_extreme_comparisons)]
35582 #[allow(unused_comparisons)]
35583 if __tmp.remaining() < Self::ENCODED_LEN {
35584 panic!(
35585 "buffer is too small (need {} bytes, but got {})",
35586 Self::ENCODED_LEN,
35587 __tmp.remaining(),
35588 )
35589 }
35590 __tmp.put_u32_le(self.sequence);
35591 __tmp.put_u32_le(self.operation as u32);
35592 __tmp.put_u8(self.result as u8);
35593 __tmp.put_u8(self.data_length);
35594 for val in &self.data {
35595 __tmp.put_u8(*val);
35596 }
35597 if matches!(version, MavlinkVersion::V2) {
35598 let len = __tmp.len();
35599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35600 } else {
35601 __tmp.len()
35602 }
35603 }
35604}
35605#[deprecated = " See `MAG_CAL_REPORT, Accel Parameters, and Gyro Parameters` (Deprecated since 2022-02)"]
35606#[doc = "id: 150"]
35607#[doc = "Offsets and calibrations values for hardware sensors. This makes it easier to debug the calibration process."]
35608#[derive(Debug, Clone, PartialEq)]
35609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35611pub struct SENSOR_OFFSETS_DATA {
35612 #[doc = "Magnetic declination."]
35613 pub mag_declination: f32,
35614 #[doc = "Raw pressure from barometer."]
35615 pub raw_press: i32,
35616 #[doc = "Raw temperature from barometer."]
35617 pub raw_temp: i32,
35618 #[doc = "Gyro X calibration."]
35619 pub gyro_cal_x: f32,
35620 #[doc = "Gyro Y calibration."]
35621 pub gyro_cal_y: f32,
35622 #[doc = "Gyro Z calibration."]
35623 pub gyro_cal_z: f32,
35624 #[doc = "Accel X calibration."]
35625 pub accel_cal_x: f32,
35626 #[doc = "Accel Y calibration."]
35627 pub accel_cal_y: f32,
35628 #[doc = "Accel Z calibration."]
35629 pub accel_cal_z: f32,
35630 #[doc = "Magnetometer X offset."]
35631 pub mag_ofs_x: i16,
35632 #[doc = "Magnetometer Y offset."]
35633 pub mag_ofs_y: i16,
35634 #[doc = "Magnetometer Z offset."]
35635 pub mag_ofs_z: i16,
35636}
35637impl SENSOR_OFFSETS_DATA {
35638 pub const ENCODED_LEN: usize = 42usize;
35639 pub const DEFAULT: Self = Self {
35640 mag_declination: 0.0_f32,
35641 raw_press: 0_i32,
35642 raw_temp: 0_i32,
35643 gyro_cal_x: 0.0_f32,
35644 gyro_cal_y: 0.0_f32,
35645 gyro_cal_z: 0.0_f32,
35646 accel_cal_x: 0.0_f32,
35647 accel_cal_y: 0.0_f32,
35648 accel_cal_z: 0.0_f32,
35649 mag_ofs_x: 0_i16,
35650 mag_ofs_y: 0_i16,
35651 mag_ofs_z: 0_i16,
35652 };
35653 #[cfg(feature = "arbitrary")]
35654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35655 use arbitrary::{Arbitrary, Unstructured};
35656 let mut buf = [0u8; 1024];
35657 rng.fill_bytes(&mut buf);
35658 let mut unstructured = Unstructured::new(&buf);
35659 Self::arbitrary(&mut unstructured).unwrap_or_default()
35660 }
35661}
35662impl Default for SENSOR_OFFSETS_DATA {
35663 fn default() -> Self {
35664 Self::DEFAULT.clone()
35665 }
35666}
35667impl MessageData for SENSOR_OFFSETS_DATA {
35668 type Message = MavMessage;
35669 const ID: u32 = 150u32;
35670 const NAME: &'static str = "SENSOR_OFFSETS";
35671 const EXTRA_CRC: u8 = 134u8;
35672 const ENCODED_LEN: usize = 42usize;
35673 fn deser(
35674 _version: MavlinkVersion,
35675 __input: &[u8],
35676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35677 let avail_len = __input.len();
35678 let mut payload_buf = [0; Self::ENCODED_LEN];
35679 let mut buf = if avail_len < Self::ENCODED_LEN {
35680 payload_buf[0..avail_len].copy_from_slice(__input);
35681 Bytes::new(&payload_buf)
35682 } else {
35683 Bytes::new(__input)
35684 };
35685 let mut __struct = Self::default();
35686 __struct.mag_declination = buf.get_f32_le();
35687 __struct.raw_press = buf.get_i32_le();
35688 __struct.raw_temp = buf.get_i32_le();
35689 __struct.gyro_cal_x = buf.get_f32_le();
35690 __struct.gyro_cal_y = buf.get_f32_le();
35691 __struct.gyro_cal_z = buf.get_f32_le();
35692 __struct.accel_cal_x = buf.get_f32_le();
35693 __struct.accel_cal_y = buf.get_f32_le();
35694 __struct.accel_cal_z = buf.get_f32_le();
35695 __struct.mag_ofs_x = buf.get_i16_le();
35696 __struct.mag_ofs_y = buf.get_i16_le();
35697 __struct.mag_ofs_z = buf.get_i16_le();
35698 Ok(__struct)
35699 }
35700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35701 let mut __tmp = BytesMut::new(bytes);
35702 #[allow(clippy::absurd_extreme_comparisons)]
35703 #[allow(unused_comparisons)]
35704 if __tmp.remaining() < Self::ENCODED_LEN {
35705 panic!(
35706 "buffer is too small (need {} bytes, but got {})",
35707 Self::ENCODED_LEN,
35708 __tmp.remaining(),
35709 )
35710 }
35711 __tmp.put_f32_le(self.mag_declination);
35712 __tmp.put_i32_le(self.raw_press);
35713 __tmp.put_i32_le(self.raw_temp);
35714 __tmp.put_f32_le(self.gyro_cal_x);
35715 __tmp.put_f32_le(self.gyro_cal_y);
35716 __tmp.put_f32_le(self.gyro_cal_z);
35717 __tmp.put_f32_le(self.accel_cal_x);
35718 __tmp.put_f32_le(self.accel_cal_y);
35719 __tmp.put_f32_le(self.accel_cal_z);
35720 __tmp.put_i16_le(self.mag_ofs_x);
35721 __tmp.put_i16_le(self.mag_ofs_y);
35722 __tmp.put_i16_le(self.mag_ofs_z);
35723 if matches!(version, MavlinkVersion::V2) {
35724 let len = __tmp.len();
35725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35726 } else {
35727 __tmp.len()
35728 }
35729 }
35730}
35731#[doc = "id: 126"]
35732#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
35733#[derive(Debug, Clone, PartialEq)]
35734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35736pub struct SERIAL_CONTROL_DATA {
35737 #[doc = "Baudrate of transfer. Zero means no change."]
35738 pub baudrate: u32,
35739 #[doc = "Timeout for reply data"]
35740 pub timeout: u16,
35741 #[doc = "Serial control device type."]
35742 pub device: SerialControlDev,
35743 #[doc = "Bitmap of serial control flags."]
35744 pub flags: SerialControlFlag,
35745 #[doc = "how many bytes in this transfer"]
35746 pub count: u8,
35747 #[doc = "serial data"]
35748 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
35749 pub data: [u8; 70],
35750 #[doc = "System ID"]
35751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35752 pub target_system: u8,
35753 #[doc = "Component ID"]
35754 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35755 pub target_component: u8,
35756}
35757impl SERIAL_CONTROL_DATA {
35758 pub const ENCODED_LEN: usize = 81usize;
35759 pub const DEFAULT: Self = Self {
35760 baudrate: 0_u32,
35761 timeout: 0_u16,
35762 device: SerialControlDev::DEFAULT,
35763 flags: SerialControlFlag::DEFAULT,
35764 count: 0_u8,
35765 data: [0_u8; 70usize],
35766 target_system: 0_u8,
35767 target_component: 0_u8,
35768 };
35769 #[cfg(feature = "arbitrary")]
35770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35771 use arbitrary::{Arbitrary, Unstructured};
35772 let mut buf = [0u8; 1024];
35773 rng.fill_bytes(&mut buf);
35774 let mut unstructured = Unstructured::new(&buf);
35775 Self::arbitrary(&mut unstructured).unwrap_or_default()
35776 }
35777}
35778impl Default for SERIAL_CONTROL_DATA {
35779 fn default() -> Self {
35780 Self::DEFAULT.clone()
35781 }
35782}
35783impl MessageData for SERIAL_CONTROL_DATA {
35784 type Message = MavMessage;
35785 const ID: u32 = 126u32;
35786 const NAME: &'static str = "SERIAL_CONTROL";
35787 const EXTRA_CRC: u8 = 220u8;
35788 const ENCODED_LEN: usize = 81usize;
35789 fn deser(
35790 _version: MavlinkVersion,
35791 __input: &[u8],
35792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35793 let avail_len = __input.len();
35794 let mut payload_buf = [0; Self::ENCODED_LEN];
35795 let mut buf = if avail_len < Self::ENCODED_LEN {
35796 payload_buf[0..avail_len].copy_from_slice(__input);
35797 Bytes::new(&payload_buf)
35798 } else {
35799 Bytes::new(__input)
35800 };
35801 let mut __struct = Self::default();
35802 __struct.baudrate = buf.get_u32_le();
35803 __struct.timeout = buf.get_u16_le();
35804 let tmp = buf.get_u8();
35805 __struct.device =
35806 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
35807 enum_type: "SerialControlDev",
35808 value: tmp as u32,
35809 })?;
35810 let tmp = buf.get_u8();
35811 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
35812 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
35813 flag_type: "SerialControlFlag",
35814 value: tmp as u32,
35815 })?;
35816 __struct.count = buf.get_u8();
35817 for v in &mut __struct.data {
35818 let val = buf.get_u8();
35819 *v = val;
35820 }
35821 __struct.target_system = buf.get_u8();
35822 __struct.target_component = buf.get_u8();
35823 Ok(__struct)
35824 }
35825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35826 let mut __tmp = BytesMut::new(bytes);
35827 #[allow(clippy::absurd_extreme_comparisons)]
35828 #[allow(unused_comparisons)]
35829 if __tmp.remaining() < Self::ENCODED_LEN {
35830 panic!(
35831 "buffer is too small (need {} bytes, but got {})",
35832 Self::ENCODED_LEN,
35833 __tmp.remaining(),
35834 )
35835 }
35836 __tmp.put_u32_le(self.baudrate);
35837 __tmp.put_u16_le(self.timeout);
35838 __tmp.put_u8(self.device as u8);
35839 __tmp.put_u8(self.flags.bits());
35840 __tmp.put_u8(self.count);
35841 for val in &self.data {
35842 __tmp.put_u8(*val);
35843 }
35844 __tmp.put_u8(self.target_system);
35845 __tmp.put_u8(self.target_component);
35846 if matches!(version, MavlinkVersion::V2) {
35847 let len = __tmp.len();
35848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
35849 } else {
35850 __tmp.len()
35851 }
35852 }
35853}
35854#[doc = "id: 36"]
35855#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
35856#[derive(Debug, Clone, PartialEq)]
35857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
35858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
35859pub struct SERVO_OUTPUT_RAW_DATA {
35860 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
35861 pub time_usec: u32,
35862 #[doc = "Servo output 1 value"]
35863 pub servo1_raw: u16,
35864 #[doc = "Servo output 2 value"]
35865 pub servo2_raw: u16,
35866 #[doc = "Servo output 3 value"]
35867 pub servo3_raw: u16,
35868 #[doc = "Servo output 4 value"]
35869 pub servo4_raw: u16,
35870 #[doc = "Servo output 5 value"]
35871 pub servo5_raw: u16,
35872 #[doc = "Servo output 6 value"]
35873 pub servo6_raw: u16,
35874 #[doc = "Servo output 7 value"]
35875 pub servo7_raw: u16,
35876 #[doc = "Servo output 8 value"]
35877 pub servo8_raw: u16,
35878 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
35879 pub port: u8,
35880 #[doc = "Servo output 9 value"]
35881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35882 pub servo9_raw: u16,
35883 #[doc = "Servo output 10 value"]
35884 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35885 pub servo10_raw: u16,
35886 #[doc = "Servo output 11 value"]
35887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35888 pub servo11_raw: u16,
35889 #[doc = "Servo output 12 value"]
35890 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35891 pub servo12_raw: u16,
35892 #[doc = "Servo output 13 value"]
35893 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35894 pub servo13_raw: u16,
35895 #[doc = "Servo output 14 value"]
35896 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35897 pub servo14_raw: u16,
35898 #[doc = "Servo output 15 value"]
35899 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35900 pub servo15_raw: u16,
35901 #[doc = "Servo output 16 value"]
35902 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
35903 pub servo16_raw: u16,
35904}
35905impl SERVO_OUTPUT_RAW_DATA {
35906 pub const ENCODED_LEN: usize = 37usize;
35907 pub const DEFAULT: Self = Self {
35908 time_usec: 0_u32,
35909 servo1_raw: 0_u16,
35910 servo2_raw: 0_u16,
35911 servo3_raw: 0_u16,
35912 servo4_raw: 0_u16,
35913 servo5_raw: 0_u16,
35914 servo6_raw: 0_u16,
35915 servo7_raw: 0_u16,
35916 servo8_raw: 0_u16,
35917 port: 0_u8,
35918 servo9_raw: 0_u16,
35919 servo10_raw: 0_u16,
35920 servo11_raw: 0_u16,
35921 servo12_raw: 0_u16,
35922 servo13_raw: 0_u16,
35923 servo14_raw: 0_u16,
35924 servo15_raw: 0_u16,
35925 servo16_raw: 0_u16,
35926 };
35927 #[cfg(feature = "arbitrary")]
35928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
35929 use arbitrary::{Arbitrary, Unstructured};
35930 let mut buf = [0u8; 1024];
35931 rng.fill_bytes(&mut buf);
35932 let mut unstructured = Unstructured::new(&buf);
35933 Self::arbitrary(&mut unstructured).unwrap_or_default()
35934 }
35935}
35936impl Default for SERVO_OUTPUT_RAW_DATA {
35937 fn default() -> Self {
35938 Self::DEFAULT.clone()
35939 }
35940}
35941impl MessageData for SERVO_OUTPUT_RAW_DATA {
35942 type Message = MavMessage;
35943 const ID: u32 = 36u32;
35944 const NAME: &'static str = "SERVO_OUTPUT_RAW";
35945 const EXTRA_CRC: u8 = 222u8;
35946 const ENCODED_LEN: usize = 37usize;
35947 fn deser(
35948 _version: MavlinkVersion,
35949 __input: &[u8],
35950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
35951 let avail_len = __input.len();
35952 let mut payload_buf = [0; Self::ENCODED_LEN];
35953 let mut buf = if avail_len < Self::ENCODED_LEN {
35954 payload_buf[0..avail_len].copy_from_slice(__input);
35955 Bytes::new(&payload_buf)
35956 } else {
35957 Bytes::new(__input)
35958 };
35959 let mut __struct = Self::default();
35960 __struct.time_usec = buf.get_u32_le();
35961 __struct.servo1_raw = buf.get_u16_le();
35962 __struct.servo2_raw = buf.get_u16_le();
35963 __struct.servo3_raw = buf.get_u16_le();
35964 __struct.servo4_raw = buf.get_u16_le();
35965 __struct.servo5_raw = buf.get_u16_le();
35966 __struct.servo6_raw = buf.get_u16_le();
35967 __struct.servo7_raw = buf.get_u16_le();
35968 __struct.servo8_raw = buf.get_u16_le();
35969 __struct.port = buf.get_u8();
35970 __struct.servo9_raw = buf.get_u16_le();
35971 __struct.servo10_raw = buf.get_u16_le();
35972 __struct.servo11_raw = buf.get_u16_le();
35973 __struct.servo12_raw = buf.get_u16_le();
35974 __struct.servo13_raw = buf.get_u16_le();
35975 __struct.servo14_raw = buf.get_u16_le();
35976 __struct.servo15_raw = buf.get_u16_le();
35977 __struct.servo16_raw = buf.get_u16_le();
35978 Ok(__struct)
35979 }
35980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35981 let mut __tmp = BytesMut::new(bytes);
35982 #[allow(clippy::absurd_extreme_comparisons)]
35983 #[allow(unused_comparisons)]
35984 if __tmp.remaining() < Self::ENCODED_LEN {
35985 panic!(
35986 "buffer is too small (need {} bytes, but got {})",
35987 Self::ENCODED_LEN,
35988 __tmp.remaining(),
35989 )
35990 }
35991 __tmp.put_u32_le(self.time_usec);
35992 __tmp.put_u16_le(self.servo1_raw);
35993 __tmp.put_u16_le(self.servo2_raw);
35994 __tmp.put_u16_le(self.servo3_raw);
35995 __tmp.put_u16_le(self.servo4_raw);
35996 __tmp.put_u16_le(self.servo5_raw);
35997 __tmp.put_u16_le(self.servo6_raw);
35998 __tmp.put_u16_le(self.servo7_raw);
35999 __tmp.put_u16_le(self.servo8_raw);
36000 __tmp.put_u8(self.port);
36001 __tmp.put_u16_le(self.servo9_raw);
36002 __tmp.put_u16_le(self.servo10_raw);
36003 __tmp.put_u16_le(self.servo11_raw);
36004 __tmp.put_u16_le(self.servo12_raw);
36005 __tmp.put_u16_le(self.servo13_raw);
36006 __tmp.put_u16_le(self.servo14_raw);
36007 __tmp.put_u16_le(self.servo15_raw);
36008 __tmp.put_u16_le(self.servo16_raw);
36009 if matches!(version, MavlinkVersion::V2) {
36010 let len = __tmp.len();
36011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36012 } else {
36013 __tmp.len()
36014 }
36015 }
36016}
36017#[doc = "id: 256"]
36018#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
36019#[derive(Debug, Clone, PartialEq)]
36020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36022pub struct SETUP_SIGNING_DATA {
36023 #[doc = "initial timestamp"]
36024 pub initial_timestamp: u64,
36025 #[doc = "system id of the target"]
36026 pub target_system: u8,
36027 #[doc = "component ID of the target"]
36028 pub target_component: u8,
36029 #[doc = "signing key"]
36030 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
36031 pub secret_key: [u8; 32],
36032}
36033impl SETUP_SIGNING_DATA {
36034 pub const ENCODED_LEN: usize = 42usize;
36035 pub const DEFAULT: Self = Self {
36036 initial_timestamp: 0_u64,
36037 target_system: 0_u8,
36038 target_component: 0_u8,
36039 secret_key: [0_u8; 32usize],
36040 };
36041 #[cfg(feature = "arbitrary")]
36042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36043 use arbitrary::{Arbitrary, Unstructured};
36044 let mut buf = [0u8; 1024];
36045 rng.fill_bytes(&mut buf);
36046 let mut unstructured = Unstructured::new(&buf);
36047 Self::arbitrary(&mut unstructured).unwrap_or_default()
36048 }
36049}
36050impl Default for SETUP_SIGNING_DATA {
36051 fn default() -> Self {
36052 Self::DEFAULT.clone()
36053 }
36054}
36055impl MessageData for SETUP_SIGNING_DATA {
36056 type Message = MavMessage;
36057 const ID: u32 = 256u32;
36058 const NAME: &'static str = "SETUP_SIGNING";
36059 const EXTRA_CRC: u8 = 71u8;
36060 const ENCODED_LEN: usize = 42usize;
36061 fn deser(
36062 _version: MavlinkVersion,
36063 __input: &[u8],
36064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36065 let avail_len = __input.len();
36066 let mut payload_buf = [0; Self::ENCODED_LEN];
36067 let mut buf = if avail_len < Self::ENCODED_LEN {
36068 payload_buf[0..avail_len].copy_from_slice(__input);
36069 Bytes::new(&payload_buf)
36070 } else {
36071 Bytes::new(__input)
36072 };
36073 let mut __struct = Self::default();
36074 __struct.initial_timestamp = buf.get_u64_le();
36075 __struct.target_system = buf.get_u8();
36076 __struct.target_component = buf.get_u8();
36077 for v in &mut __struct.secret_key {
36078 let val = buf.get_u8();
36079 *v = val;
36080 }
36081 Ok(__struct)
36082 }
36083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36084 let mut __tmp = BytesMut::new(bytes);
36085 #[allow(clippy::absurd_extreme_comparisons)]
36086 #[allow(unused_comparisons)]
36087 if __tmp.remaining() < Self::ENCODED_LEN {
36088 panic!(
36089 "buffer is too small (need {} bytes, but got {})",
36090 Self::ENCODED_LEN,
36091 __tmp.remaining(),
36092 )
36093 }
36094 __tmp.put_u64_le(self.initial_timestamp);
36095 __tmp.put_u8(self.target_system);
36096 __tmp.put_u8(self.target_component);
36097 for val in &self.secret_key {
36098 __tmp.put_u8(*val);
36099 }
36100 if matches!(version, MavlinkVersion::V2) {
36101 let len = __tmp.len();
36102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36103 } else {
36104 __tmp.len()
36105 }
36106 }
36107}
36108#[doc = "id: 139"]
36109#[doc = "Set the vehicle attitude and body angular rates."]
36110#[derive(Debug, Clone, PartialEq)]
36111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36113pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
36114 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
36115 pub time_usec: u64,
36116 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
36117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
36118 pub controls: [f32; 8],
36119 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
36120 pub group_mlx: u8,
36121 #[doc = "System ID"]
36122 pub target_system: u8,
36123 #[doc = "Component ID"]
36124 pub target_component: u8,
36125}
36126impl SET_ACTUATOR_CONTROL_TARGET_DATA {
36127 pub const ENCODED_LEN: usize = 43usize;
36128 pub const DEFAULT: Self = Self {
36129 time_usec: 0_u64,
36130 controls: [0.0_f32; 8usize],
36131 group_mlx: 0_u8,
36132 target_system: 0_u8,
36133 target_component: 0_u8,
36134 };
36135 #[cfg(feature = "arbitrary")]
36136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36137 use arbitrary::{Arbitrary, Unstructured};
36138 let mut buf = [0u8; 1024];
36139 rng.fill_bytes(&mut buf);
36140 let mut unstructured = Unstructured::new(&buf);
36141 Self::arbitrary(&mut unstructured).unwrap_or_default()
36142 }
36143}
36144impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
36145 fn default() -> Self {
36146 Self::DEFAULT.clone()
36147 }
36148}
36149impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
36150 type Message = MavMessage;
36151 const ID: u32 = 139u32;
36152 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
36153 const EXTRA_CRC: u8 = 168u8;
36154 const ENCODED_LEN: usize = 43usize;
36155 fn deser(
36156 _version: MavlinkVersion,
36157 __input: &[u8],
36158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36159 let avail_len = __input.len();
36160 let mut payload_buf = [0; Self::ENCODED_LEN];
36161 let mut buf = if avail_len < Self::ENCODED_LEN {
36162 payload_buf[0..avail_len].copy_from_slice(__input);
36163 Bytes::new(&payload_buf)
36164 } else {
36165 Bytes::new(__input)
36166 };
36167 let mut __struct = Self::default();
36168 __struct.time_usec = buf.get_u64_le();
36169 for v in &mut __struct.controls {
36170 let val = buf.get_f32_le();
36171 *v = val;
36172 }
36173 __struct.group_mlx = buf.get_u8();
36174 __struct.target_system = buf.get_u8();
36175 __struct.target_component = buf.get_u8();
36176 Ok(__struct)
36177 }
36178 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36179 let mut __tmp = BytesMut::new(bytes);
36180 #[allow(clippy::absurd_extreme_comparisons)]
36181 #[allow(unused_comparisons)]
36182 if __tmp.remaining() < Self::ENCODED_LEN {
36183 panic!(
36184 "buffer is too small (need {} bytes, but got {})",
36185 Self::ENCODED_LEN,
36186 __tmp.remaining(),
36187 )
36188 }
36189 __tmp.put_u64_le(self.time_usec);
36190 for val in &self.controls {
36191 __tmp.put_f32_le(*val);
36192 }
36193 __tmp.put_u8(self.group_mlx);
36194 __tmp.put_u8(self.target_system);
36195 __tmp.put_u8(self.target_component);
36196 if matches!(version, MavlinkVersion::V2) {
36197 let len = __tmp.len();
36198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36199 } else {
36200 __tmp.len()
36201 }
36202 }
36203}
36204#[doc = "id: 82"]
36205#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
36206#[derive(Debug, Clone, PartialEq)]
36207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36209pub struct SET_ATTITUDE_TARGET_DATA {
36210 #[doc = "Timestamp (time since system boot)."]
36211 pub time_boot_ms: u32,
36212 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
36213 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
36214 pub q: [f32; 4],
36215 #[doc = "Body roll rate"]
36216 pub body_roll_rate: f32,
36217 #[doc = "Body pitch rate"]
36218 pub body_pitch_rate: f32,
36219 #[doc = "Body yaw rate"]
36220 pub body_yaw_rate: f32,
36221 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
36222 pub thrust: f32,
36223 #[doc = "System ID"]
36224 pub target_system: u8,
36225 #[doc = "Component ID"]
36226 pub target_component: u8,
36227 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
36228 pub type_mask: AttitudeTargetTypemask,
36229 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
36230 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
36231 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
36232 pub thrust_body: [f32; 3],
36233}
36234impl SET_ATTITUDE_TARGET_DATA {
36235 pub const ENCODED_LEN: usize = 51usize;
36236 pub const DEFAULT: Self = Self {
36237 time_boot_ms: 0_u32,
36238 q: [0.0_f32; 4usize],
36239 body_roll_rate: 0.0_f32,
36240 body_pitch_rate: 0.0_f32,
36241 body_yaw_rate: 0.0_f32,
36242 thrust: 0.0_f32,
36243 target_system: 0_u8,
36244 target_component: 0_u8,
36245 type_mask: AttitudeTargetTypemask::DEFAULT,
36246 thrust_body: [0.0_f32; 3usize],
36247 };
36248 #[cfg(feature = "arbitrary")]
36249 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36250 use arbitrary::{Arbitrary, Unstructured};
36251 let mut buf = [0u8; 1024];
36252 rng.fill_bytes(&mut buf);
36253 let mut unstructured = Unstructured::new(&buf);
36254 Self::arbitrary(&mut unstructured).unwrap_or_default()
36255 }
36256}
36257impl Default for SET_ATTITUDE_TARGET_DATA {
36258 fn default() -> Self {
36259 Self::DEFAULT.clone()
36260 }
36261}
36262impl MessageData for SET_ATTITUDE_TARGET_DATA {
36263 type Message = MavMessage;
36264 const ID: u32 = 82u32;
36265 const NAME: &'static str = "SET_ATTITUDE_TARGET";
36266 const EXTRA_CRC: u8 = 49u8;
36267 const ENCODED_LEN: usize = 51usize;
36268 fn deser(
36269 _version: MavlinkVersion,
36270 __input: &[u8],
36271 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36272 let avail_len = __input.len();
36273 let mut payload_buf = [0; Self::ENCODED_LEN];
36274 let mut buf = if avail_len < Self::ENCODED_LEN {
36275 payload_buf[0..avail_len].copy_from_slice(__input);
36276 Bytes::new(&payload_buf)
36277 } else {
36278 Bytes::new(__input)
36279 };
36280 let mut __struct = Self::default();
36281 __struct.time_boot_ms = buf.get_u32_le();
36282 for v in &mut __struct.q {
36283 let val = buf.get_f32_le();
36284 *v = val;
36285 }
36286 __struct.body_roll_rate = buf.get_f32_le();
36287 __struct.body_pitch_rate = buf.get_f32_le();
36288 __struct.body_yaw_rate = buf.get_f32_le();
36289 __struct.thrust = buf.get_f32_le();
36290 __struct.target_system = buf.get_u8();
36291 __struct.target_component = buf.get_u8();
36292 let tmp = buf.get_u8();
36293 __struct.type_mask = AttitudeTargetTypemask::from_bits(
36294 tmp & AttitudeTargetTypemask::all().bits(),
36295 )
36296 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
36297 flag_type: "AttitudeTargetTypemask",
36298 value: tmp as u32,
36299 })?;
36300 for v in &mut __struct.thrust_body {
36301 let val = buf.get_f32_le();
36302 *v = val;
36303 }
36304 Ok(__struct)
36305 }
36306 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36307 let mut __tmp = BytesMut::new(bytes);
36308 #[allow(clippy::absurd_extreme_comparisons)]
36309 #[allow(unused_comparisons)]
36310 if __tmp.remaining() < Self::ENCODED_LEN {
36311 panic!(
36312 "buffer is too small (need {} bytes, but got {})",
36313 Self::ENCODED_LEN,
36314 __tmp.remaining(),
36315 )
36316 }
36317 __tmp.put_u32_le(self.time_boot_ms);
36318 for val in &self.q {
36319 __tmp.put_f32_le(*val);
36320 }
36321 __tmp.put_f32_le(self.body_roll_rate);
36322 __tmp.put_f32_le(self.body_pitch_rate);
36323 __tmp.put_f32_le(self.body_yaw_rate);
36324 __tmp.put_f32_le(self.thrust);
36325 __tmp.put_u8(self.target_system);
36326 __tmp.put_u8(self.target_component);
36327 __tmp.put_u8(self.type_mask.bits());
36328 for val in &self.thrust_body {
36329 __tmp.put_f32_le(*val);
36330 }
36331 if matches!(version, MavlinkVersion::V2) {
36332 let len = __tmp.len();
36333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36334 } else {
36335 __tmp.len()
36336 }
36337 }
36338}
36339#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
36340#[doc = "id: 48"]
36341#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
36342#[derive(Debug, Clone, PartialEq)]
36343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36345pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
36346 #[doc = "Latitude (WGS84)"]
36347 pub latitude: i32,
36348 #[doc = "Longitude (WGS84)"]
36349 pub longitude: i32,
36350 #[doc = "Altitude (MSL). Positive for up."]
36351 pub altitude: i32,
36352 #[doc = "System ID"]
36353 pub target_system: u8,
36354 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
36355 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
36356 pub time_usec: u64,
36357}
36358impl SET_GPS_GLOBAL_ORIGIN_DATA {
36359 pub const ENCODED_LEN: usize = 21usize;
36360 pub const DEFAULT: Self = Self {
36361 latitude: 0_i32,
36362 longitude: 0_i32,
36363 altitude: 0_i32,
36364 target_system: 0_u8,
36365 time_usec: 0_u64,
36366 };
36367 #[cfg(feature = "arbitrary")]
36368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36369 use arbitrary::{Arbitrary, Unstructured};
36370 let mut buf = [0u8; 1024];
36371 rng.fill_bytes(&mut buf);
36372 let mut unstructured = Unstructured::new(&buf);
36373 Self::arbitrary(&mut unstructured).unwrap_or_default()
36374 }
36375}
36376impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
36377 fn default() -> Self {
36378 Self::DEFAULT.clone()
36379 }
36380}
36381impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
36382 type Message = MavMessage;
36383 const ID: u32 = 48u32;
36384 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
36385 const EXTRA_CRC: u8 = 41u8;
36386 const ENCODED_LEN: usize = 21usize;
36387 fn deser(
36388 _version: MavlinkVersion,
36389 __input: &[u8],
36390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36391 let avail_len = __input.len();
36392 let mut payload_buf = [0; Self::ENCODED_LEN];
36393 let mut buf = if avail_len < Self::ENCODED_LEN {
36394 payload_buf[0..avail_len].copy_from_slice(__input);
36395 Bytes::new(&payload_buf)
36396 } else {
36397 Bytes::new(__input)
36398 };
36399 let mut __struct = Self::default();
36400 __struct.latitude = buf.get_i32_le();
36401 __struct.longitude = buf.get_i32_le();
36402 __struct.altitude = buf.get_i32_le();
36403 __struct.target_system = buf.get_u8();
36404 __struct.time_usec = buf.get_u64_le();
36405 Ok(__struct)
36406 }
36407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36408 let mut __tmp = BytesMut::new(bytes);
36409 #[allow(clippy::absurd_extreme_comparisons)]
36410 #[allow(unused_comparisons)]
36411 if __tmp.remaining() < Self::ENCODED_LEN {
36412 panic!(
36413 "buffer is too small (need {} bytes, but got {})",
36414 Self::ENCODED_LEN,
36415 __tmp.remaining(),
36416 )
36417 }
36418 __tmp.put_i32_le(self.latitude);
36419 __tmp.put_i32_le(self.longitude);
36420 __tmp.put_i32_le(self.altitude);
36421 __tmp.put_u8(self.target_system);
36422 __tmp.put_u64_le(self.time_usec);
36423 if matches!(version, MavlinkVersion::V2) {
36424 let len = __tmp.len();
36425 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36426 } else {
36427 __tmp.len()
36428 }
36429 }
36430}
36431#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
36432#[doc = "id: 243"]
36433#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
36434#[derive(Debug, Clone, PartialEq)]
36435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36437pub struct SET_HOME_POSITION_DATA {
36438 #[doc = "Latitude (WGS84)"]
36439 pub latitude: i32,
36440 #[doc = "Longitude (WGS84)"]
36441 pub longitude: i32,
36442 #[doc = "Altitude (MSL). Positive for up."]
36443 pub altitude: i32,
36444 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
36445 pub x: f32,
36446 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
36447 pub y: f32,
36448 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
36449 pub z: f32,
36450 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
36451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
36452 pub q: [f32; 4],
36453 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
36454 pub approach_x: f32,
36455 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
36456 pub approach_y: f32,
36457 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
36458 pub approach_z: f32,
36459 #[doc = "System ID."]
36460 pub target_system: u8,
36461 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
36462 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
36463 pub time_usec: u64,
36464}
36465impl SET_HOME_POSITION_DATA {
36466 pub const ENCODED_LEN: usize = 61usize;
36467 pub const DEFAULT: Self = Self {
36468 latitude: 0_i32,
36469 longitude: 0_i32,
36470 altitude: 0_i32,
36471 x: 0.0_f32,
36472 y: 0.0_f32,
36473 z: 0.0_f32,
36474 q: [0.0_f32; 4usize],
36475 approach_x: 0.0_f32,
36476 approach_y: 0.0_f32,
36477 approach_z: 0.0_f32,
36478 target_system: 0_u8,
36479 time_usec: 0_u64,
36480 };
36481 #[cfg(feature = "arbitrary")]
36482 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36483 use arbitrary::{Arbitrary, Unstructured};
36484 let mut buf = [0u8; 1024];
36485 rng.fill_bytes(&mut buf);
36486 let mut unstructured = Unstructured::new(&buf);
36487 Self::arbitrary(&mut unstructured).unwrap_or_default()
36488 }
36489}
36490impl Default for SET_HOME_POSITION_DATA {
36491 fn default() -> Self {
36492 Self::DEFAULT.clone()
36493 }
36494}
36495impl MessageData for SET_HOME_POSITION_DATA {
36496 type Message = MavMessage;
36497 const ID: u32 = 243u32;
36498 const NAME: &'static str = "SET_HOME_POSITION";
36499 const EXTRA_CRC: u8 = 85u8;
36500 const ENCODED_LEN: usize = 61usize;
36501 fn deser(
36502 _version: MavlinkVersion,
36503 __input: &[u8],
36504 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36505 let avail_len = __input.len();
36506 let mut payload_buf = [0; Self::ENCODED_LEN];
36507 let mut buf = if avail_len < Self::ENCODED_LEN {
36508 payload_buf[0..avail_len].copy_from_slice(__input);
36509 Bytes::new(&payload_buf)
36510 } else {
36511 Bytes::new(__input)
36512 };
36513 let mut __struct = Self::default();
36514 __struct.latitude = buf.get_i32_le();
36515 __struct.longitude = buf.get_i32_le();
36516 __struct.altitude = buf.get_i32_le();
36517 __struct.x = buf.get_f32_le();
36518 __struct.y = buf.get_f32_le();
36519 __struct.z = buf.get_f32_le();
36520 for v in &mut __struct.q {
36521 let val = buf.get_f32_le();
36522 *v = val;
36523 }
36524 __struct.approach_x = buf.get_f32_le();
36525 __struct.approach_y = buf.get_f32_le();
36526 __struct.approach_z = buf.get_f32_le();
36527 __struct.target_system = buf.get_u8();
36528 __struct.time_usec = buf.get_u64_le();
36529 Ok(__struct)
36530 }
36531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36532 let mut __tmp = BytesMut::new(bytes);
36533 #[allow(clippy::absurd_extreme_comparisons)]
36534 #[allow(unused_comparisons)]
36535 if __tmp.remaining() < Self::ENCODED_LEN {
36536 panic!(
36537 "buffer is too small (need {} bytes, but got {})",
36538 Self::ENCODED_LEN,
36539 __tmp.remaining(),
36540 )
36541 }
36542 __tmp.put_i32_le(self.latitude);
36543 __tmp.put_i32_le(self.longitude);
36544 __tmp.put_i32_le(self.altitude);
36545 __tmp.put_f32_le(self.x);
36546 __tmp.put_f32_le(self.y);
36547 __tmp.put_f32_le(self.z);
36548 for val in &self.q {
36549 __tmp.put_f32_le(*val);
36550 }
36551 __tmp.put_f32_le(self.approach_x);
36552 __tmp.put_f32_le(self.approach_y);
36553 __tmp.put_f32_le(self.approach_z);
36554 __tmp.put_u8(self.target_system);
36555 __tmp.put_u64_le(self.time_usec);
36556 if matches!(version, MavlinkVersion::V2) {
36557 let len = __tmp.len();
36558 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36559 } else {
36560 __tmp.len()
36561 }
36562 }
36563}
36564#[deprecated = " See `MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS` (Deprecated since 2014-07)"]
36565#[doc = "id: 151"]
36566#[doc = "Set the magnetometer offsets."]
36567#[derive(Debug, Clone, PartialEq)]
36568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36570pub struct SET_MAG_OFFSETS_DATA {
36571 #[doc = "Magnetometer X offset."]
36572 pub mag_ofs_x: i16,
36573 #[doc = "Magnetometer Y offset."]
36574 pub mag_ofs_y: i16,
36575 #[doc = "Magnetometer Z offset."]
36576 pub mag_ofs_z: i16,
36577 #[doc = "System ID."]
36578 pub target_system: u8,
36579 #[doc = "Component ID."]
36580 pub target_component: u8,
36581}
36582impl SET_MAG_OFFSETS_DATA {
36583 pub const ENCODED_LEN: usize = 8usize;
36584 pub const DEFAULT: Self = Self {
36585 mag_ofs_x: 0_i16,
36586 mag_ofs_y: 0_i16,
36587 mag_ofs_z: 0_i16,
36588 target_system: 0_u8,
36589 target_component: 0_u8,
36590 };
36591 #[cfg(feature = "arbitrary")]
36592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36593 use arbitrary::{Arbitrary, Unstructured};
36594 let mut buf = [0u8; 1024];
36595 rng.fill_bytes(&mut buf);
36596 let mut unstructured = Unstructured::new(&buf);
36597 Self::arbitrary(&mut unstructured).unwrap_or_default()
36598 }
36599}
36600impl Default for SET_MAG_OFFSETS_DATA {
36601 fn default() -> Self {
36602 Self::DEFAULT.clone()
36603 }
36604}
36605impl MessageData for SET_MAG_OFFSETS_DATA {
36606 type Message = MavMessage;
36607 const ID: u32 = 151u32;
36608 const NAME: &'static str = "SET_MAG_OFFSETS";
36609 const EXTRA_CRC: u8 = 219u8;
36610 const ENCODED_LEN: usize = 8usize;
36611 fn deser(
36612 _version: MavlinkVersion,
36613 __input: &[u8],
36614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36615 let avail_len = __input.len();
36616 let mut payload_buf = [0; Self::ENCODED_LEN];
36617 let mut buf = if avail_len < Self::ENCODED_LEN {
36618 payload_buf[0..avail_len].copy_from_slice(__input);
36619 Bytes::new(&payload_buf)
36620 } else {
36621 Bytes::new(__input)
36622 };
36623 let mut __struct = Self::default();
36624 __struct.mag_ofs_x = buf.get_i16_le();
36625 __struct.mag_ofs_y = buf.get_i16_le();
36626 __struct.mag_ofs_z = buf.get_i16_le();
36627 __struct.target_system = buf.get_u8();
36628 __struct.target_component = buf.get_u8();
36629 Ok(__struct)
36630 }
36631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36632 let mut __tmp = BytesMut::new(bytes);
36633 #[allow(clippy::absurd_extreme_comparisons)]
36634 #[allow(unused_comparisons)]
36635 if __tmp.remaining() < Self::ENCODED_LEN {
36636 panic!(
36637 "buffer is too small (need {} bytes, but got {})",
36638 Self::ENCODED_LEN,
36639 __tmp.remaining(),
36640 )
36641 }
36642 __tmp.put_i16_le(self.mag_ofs_x);
36643 __tmp.put_i16_le(self.mag_ofs_y);
36644 __tmp.put_i16_le(self.mag_ofs_z);
36645 __tmp.put_u8(self.target_system);
36646 __tmp.put_u8(self.target_component);
36647 if matches!(version, MavlinkVersion::V2) {
36648 let len = __tmp.len();
36649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36650 } else {
36651 __tmp.len()
36652 }
36653 }
36654}
36655#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
36656#[doc = "id: 11"]
36657#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
36658#[derive(Debug, Clone, PartialEq)]
36659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36661pub struct SET_MODE_DATA {
36662 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
36663 pub custom_mode: u32,
36664 #[doc = "The system setting the mode"]
36665 pub target_system: u8,
36666 #[doc = "The new base mode."]
36667 pub base_mode: MavMode,
36668}
36669impl SET_MODE_DATA {
36670 pub const ENCODED_LEN: usize = 6usize;
36671 pub const DEFAULT: Self = Self {
36672 custom_mode: 0_u32,
36673 target_system: 0_u8,
36674 base_mode: MavMode::DEFAULT,
36675 };
36676 #[cfg(feature = "arbitrary")]
36677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36678 use arbitrary::{Arbitrary, Unstructured};
36679 let mut buf = [0u8; 1024];
36680 rng.fill_bytes(&mut buf);
36681 let mut unstructured = Unstructured::new(&buf);
36682 Self::arbitrary(&mut unstructured).unwrap_or_default()
36683 }
36684}
36685impl Default for SET_MODE_DATA {
36686 fn default() -> Self {
36687 Self::DEFAULT.clone()
36688 }
36689}
36690impl MessageData for SET_MODE_DATA {
36691 type Message = MavMessage;
36692 const ID: u32 = 11u32;
36693 const NAME: &'static str = "SET_MODE";
36694 const EXTRA_CRC: u8 = 89u8;
36695 const ENCODED_LEN: usize = 6usize;
36696 fn deser(
36697 _version: MavlinkVersion,
36698 __input: &[u8],
36699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36700 let avail_len = __input.len();
36701 let mut payload_buf = [0; Self::ENCODED_LEN];
36702 let mut buf = if avail_len < Self::ENCODED_LEN {
36703 payload_buf[0..avail_len].copy_from_slice(__input);
36704 Bytes::new(&payload_buf)
36705 } else {
36706 Bytes::new(__input)
36707 };
36708 let mut __struct = Self::default();
36709 __struct.custom_mode = buf.get_u32_le();
36710 __struct.target_system = buf.get_u8();
36711 let tmp = buf.get_u8();
36712 __struct.base_mode =
36713 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
36714 enum_type: "MavMode",
36715 value: tmp as u32,
36716 })?;
36717 Ok(__struct)
36718 }
36719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36720 let mut __tmp = BytesMut::new(bytes);
36721 #[allow(clippy::absurd_extreme_comparisons)]
36722 #[allow(unused_comparisons)]
36723 if __tmp.remaining() < Self::ENCODED_LEN {
36724 panic!(
36725 "buffer is too small (need {} bytes, but got {})",
36726 Self::ENCODED_LEN,
36727 __tmp.remaining(),
36728 )
36729 }
36730 __tmp.put_u32_le(self.custom_mode);
36731 __tmp.put_u8(self.target_system);
36732 __tmp.put_u8(self.base_mode as u8);
36733 if matches!(version, MavlinkVersion::V2) {
36734 let len = __tmp.len();
36735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36736 } else {
36737 __tmp.len()
36738 }
36739 }
36740}
36741#[doc = "id: 86"]
36742#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
36743#[derive(Debug, Clone, PartialEq)]
36744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36746pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
36747 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
36748 pub time_boot_ms: u32,
36749 #[doc = "Latitude in WGS84 frame"]
36750 pub lat_int: i32,
36751 #[doc = "Longitude in WGS84 frame"]
36752 pub lon_int: i32,
36753 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
36754 pub alt: f32,
36755 #[doc = "X velocity in NED frame"]
36756 pub vx: f32,
36757 #[doc = "Y velocity in NED frame"]
36758 pub vy: f32,
36759 #[doc = "Z velocity in NED frame"]
36760 pub vz: f32,
36761 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36762 pub afx: f32,
36763 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36764 pub afy: f32,
36765 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36766 pub afz: f32,
36767 #[doc = "yaw setpoint"]
36768 pub yaw: f32,
36769 #[doc = "yaw rate setpoint"]
36770 pub yaw_rate: f32,
36771 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
36772 pub type_mask: PositionTargetTypemask,
36773 #[doc = "System ID"]
36774 pub target_system: u8,
36775 #[doc = "Component ID"]
36776 pub target_component: u8,
36777 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
36778 pub coordinate_frame: MavFrame,
36779}
36780impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
36781 pub const ENCODED_LEN: usize = 53usize;
36782 pub const DEFAULT: Self = Self {
36783 time_boot_ms: 0_u32,
36784 lat_int: 0_i32,
36785 lon_int: 0_i32,
36786 alt: 0.0_f32,
36787 vx: 0.0_f32,
36788 vy: 0.0_f32,
36789 vz: 0.0_f32,
36790 afx: 0.0_f32,
36791 afy: 0.0_f32,
36792 afz: 0.0_f32,
36793 yaw: 0.0_f32,
36794 yaw_rate: 0.0_f32,
36795 type_mask: PositionTargetTypemask::DEFAULT,
36796 target_system: 0_u8,
36797 target_component: 0_u8,
36798 coordinate_frame: MavFrame::DEFAULT,
36799 };
36800 #[cfg(feature = "arbitrary")]
36801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36802 use arbitrary::{Arbitrary, Unstructured};
36803 let mut buf = [0u8; 1024];
36804 rng.fill_bytes(&mut buf);
36805 let mut unstructured = Unstructured::new(&buf);
36806 Self::arbitrary(&mut unstructured).unwrap_or_default()
36807 }
36808}
36809impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
36810 fn default() -> Self {
36811 Self::DEFAULT.clone()
36812 }
36813}
36814impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
36815 type Message = MavMessage;
36816 const ID: u32 = 86u32;
36817 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
36818 const EXTRA_CRC: u8 = 5u8;
36819 const ENCODED_LEN: usize = 53usize;
36820 fn deser(
36821 _version: MavlinkVersion,
36822 __input: &[u8],
36823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36824 let avail_len = __input.len();
36825 let mut payload_buf = [0; Self::ENCODED_LEN];
36826 let mut buf = if avail_len < Self::ENCODED_LEN {
36827 payload_buf[0..avail_len].copy_from_slice(__input);
36828 Bytes::new(&payload_buf)
36829 } else {
36830 Bytes::new(__input)
36831 };
36832 let mut __struct = Self::default();
36833 __struct.time_boot_ms = buf.get_u32_le();
36834 __struct.lat_int = buf.get_i32_le();
36835 __struct.lon_int = buf.get_i32_le();
36836 __struct.alt = buf.get_f32_le();
36837 __struct.vx = buf.get_f32_le();
36838 __struct.vy = buf.get_f32_le();
36839 __struct.vz = buf.get_f32_le();
36840 __struct.afx = buf.get_f32_le();
36841 __struct.afy = buf.get_f32_le();
36842 __struct.afz = buf.get_f32_le();
36843 __struct.yaw = buf.get_f32_le();
36844 __struct.yaw_rate = buf.get_f32_le();
36845 let tmp = buf.get_u16_le();
36846 __struct.type_mask = PositionTargetTypemask::from_bits(
36847 tmp & PositionTargetTypemask::all().bits(),
36848 )
36849 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
36850 flag_type: "PositionTargetTypemask",
36851 value: tmp as u32,
36852 })?;
36853 __struct.target_system = buf.get_u8();
36854 __struct.target_component = buf.get_u8();
36855 let tmp = buf.get_u8();
36856 __struct.coordinate_frame =
36857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
36858 enum_type: "MavFrame",
36859 value: tmp as u32,
36860 })?;
36861 Ok(__struct)
36862 }
36863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36864 let mut __tmp = BytesMut::new(bytes);
36865 #[allow(clippy::absurd_extreme_comparisons)]
36866 #[allow(unused_comparisons)]
36867 if __tmp.remaining() < Self::ENCODED_LEN {
36868 panic!(
36869 "buffer is too small (need {} bytes, but got {})",
36870 Self::ENCODED_LEN,
36871 __tmp.remaining(),
36872 )
36873 }
36874 __tmp.put_u32_le(self.time_boot_ms);
36875 __tmp.put_i32_le(self.lat_int);
36876 __tmp.put_i32_le(self.lon_int);
36877 __tmp.put_f32_le(self.alt);
36878 __tmp.put_f32_le(self.vx);
36879 __tmp.put_f32_le(self.vy);
36880 __tmp.put_f32_le(self.vz);
36881 __tmp.put_f32_le(self.afx);
36882 __tmp.put_f32_le(self.afy);
36883 __tmp.put_f32_le(self.afz);
36884 __tmp.put_f32_le(self.yaw);
36885 __tmp.put_f32_le(self.yaw_rate);
36886 __tmp.put_u16_le(self.type_mask.bits());
36887 __tmp.put_u8(self.target_system);
36888 __tmp.put_u8(self.target_component);
36889 __tmp.put_u8(self.coordinate_frame as u8);
36890 if matches!(version, MavlinkVersion::V2) {
36891 let len = __tmp.len();
36892 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
36893 } else {
36894 __tmp.len()
36895 }
36896 }
36897}
36898#[doc = "id: 84"]
36899#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
36900#[derive(Debug, Clone, PartialEq)]
36901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
36902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
36903pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
36904 #[doc = "Timestamp (time since system boot)."]
36905 pub time_boot_ms: u32,
36906 #[doc = "X Position in NED frame"]
36907 pub x: f32,
36908 #[doc = "Y Position in NED frame"]
36909 pub y: f32,
36910 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
36911 pub z: f32,
36912 #[doc = "X velocity in NED frame"]
36913 pub vx: f32,
36914 #[doc = "Y velocity in NED frame"]
36915 pub vy: f32,
36916 #[doc = "Z velocity in NED frame"]
36917 pub vz: f32,
36918 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36919 pub afx: f32,
36920 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36921 pub afy: f32,
36922 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
36923 pub afz: f32,
36924 #[doc = "yaw setpoint"]
36925 pub yaw: f32,
36926 #[doc = "yaw rate setpoint"]
36927 pub yaw_rate: f32,
36928 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
36929 pub type_mask: PositionTargetTypemask,
36930 #[doc = "System ID"]
36931 pub target_system: u8,
36932 #[doc = "Component ID"]
36933 pub target_component: u8,
36934 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
36935 pub coordinate_frame: MavFrame,
36936}
36937impl SET_POSITION_TARGET_LOCAL_NED_DATA {
36938 pub const ENCODED_LEN: usize = 53usize;
36939 pub const DEFAULT: Self = Self {
36940 time_boot_ms: 0_u32,
36941 x: 0.0_f32,
36942 y: 0.0_f32,
36943 z: 0.0_f32,
36944 vx: 0.0_f32,
36945 vy: 0.0_f32,
36946 vz: 0.0_f32,
36947 afx: 0.0_f32,
36948 afy: 0.0_f32,
36949 afz: 0.0_f32,
36950 yaw: 0.0_f32,
36951 yaw_rate: 0.0_f32,
36952 type_mask: PositionTargetTypemask::DEFAULT,
36953 target_system: 0_u8,
36954 target_component: 0_u8,
36955 coordinate_frame: MavFrame::DEFAULT,
36956 };
36957 #[cfg(feature = "arbitrary")]
36958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
36959 use arbitrary::{Arbitrary, Unstructured};
36960 let mut buf = [0u8; 1024];
36961 rng.fill_bytes(&mut buf);
36962 let mut unstructured = Unstructured::new(&buf);
36963 Self::arbitrary(&mut unstructured).unwrap_or_default()
36964 }
36965}
36966impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
36967 fn default() -> Self {
36968 Self::DEFAULT.clone()
36969 }
36970}
36971impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
36972 type Message = MavMessage;
36973 const ID: u32 = 84u32;
36974 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
36975 const EXTRA_CRC: u8 = 143u8;
36976 const ENCODED_LEN: usize = 53usize;
36977 fn deser(
36978 _version: MavlinkVersion,
36979 __input: &[u8],
36980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
36981 let avail_len = __input.len();
36982 let mut payload_buf = [0; Self::ENCODED_LEN];
36983 let mut buf = if avail_len < Self::ENCODED_LEN {
36984 payload_buf[0..avail_len].copy_from_slice(__input);
36985 Bytes::new(&payload_buf)
36986 } else {
36987 Bytes::new(__input)
36988 };
36989 let mut __struct = Self::default();
36990 __struct.time_boot_ms = buf.get_u32_le();
36991 __struct.x = buf.get_f32_le();
36992 __struct.y = buf.get_f32_le();
36993 __struct.z = buf.get_f32_le();
36994 __struct.vx = buf.get_f32_le();
36995 __struct.vy = buf.get_f32_le();
36996 __struct.vz = buf.get_f32_le();
36997 __struct.afx = buf.get_f32_le();
36998 __struct.afy = buf.get_f32_le();
36999 __struct.afz = buf.get_f32_le();
37000 __struct.yaw = buf.get_f32_le();
37001 __struct.yaw_rate = buf.get_f32_le();
37002 let tmp = buf.get_u16_le();
37003 __struct.type_mask = PositionTargetTypemask::from_bits(
37004 tmp & PositionTargetTypemask::all().bits(),
37005 )
37006 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
37007 flag_type: "PositionTargetTypemask",
37008 value: tmp as u32,
37009 })?;
37010 __struct.target_system = buf.get_u8();
37011 __struct.target_component = buf.get_u8();
37012 let tmp = buf.get_u8();
37013 __struct.coordinate_frame =
37014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37015 enum_type: "MavFrame",
37016 value: tmp as u32,
37017 })?;
37018 Ok(__struct)
37019 }
37020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37021 let mut __tmp = BytesMut::new(bytes);
37022 #[allow(clippy::absurd_extreme_comparisons)]
37023 #[allow(unused_comparisons)]
37024 if __tmp.remaining() < Self::ENCODED_LEN {
37025 panic!(
37026 "buffer is too small (need {} bytes, but got {})",
37027 Self::ENCODED_LEN,
37028 __tmp.remaining(),
37029 )
37030 }
37031 __tmp.put_u32_le(self.time_boot_ms);
37032 __tmp.put_f32_le(self.x);
37033 __tmp.put_f32_le(self.y);
37034 __tmp.put_f32_le(self.z);
37035 __tmp.put_f32_le(self.vx);
37036 __tmp.put_f32_le(self.vy);
37037 __tmp.put_f32_le(self.vz);
37038 __tmp.put_f32_le(self.afx);
37039 __tmp.put_f32_le(self.afy);
37040 __tmp.put_f32_le(self.afz);
37041 __tmp.put_f32_le(self.yaw);
37042 __tmp.put_f32_le(self.yaw_rate);
37043 __tmp.put_u16_le(self.type_mask.bits());
37044 __tmp.put_u8(self.target_system);
37045 __tmp.put_u8(self.target_component);
37046 __tmp.put_u8(self.coordinate_frame as u8);
37047 if matches!(version, MavlinkVersion::V2) {
37048 let len = __tmp.len();
37049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37050 } else {
37051 __tmp.len()
37052 }
37053 }
37054}
37055#[doc = "id: 164"]
37056#[doc = "Status of simulation environment, if used."]
37057#[derive(Debug, Clone, PartialEq)]
37058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37060pub struct SIMSTATE_DATA {
37061 #[doc = "Roll angle."]
37062 pub roll: f32,
37063 #[doc = "Pitch angle."]
37064 pub pitch: f32,
37065 #[doc = "Yaw angle."]
37066 pub yaw: f32,
37067 #[doc = "X acceleration."]
37068 pub xacc: f32,
37069 #[doc = "Y acceleration."]
37070 pub yacc: f32,
37071 #[doc = "Z acceleration."]
37072 pub zacc: f32,
37073 #[doc = "Angular speed around X axis."]
37074 pub xgyro: f32,
37075 #[doc = "Angular speed around Y axis."]
37076 pub ygyro: f32,
37077 #[doc = "Angular speed around Z axis."]
37078 pub zgyro: f32,
37079 #[doc = "Latitude."]
37080 pub lat: i32,
37081 #[doc = "Longitude."]
37082 pub lng: i32,
37083}
37084impl SIMSTATE_DATA {
37085 pub const ENCODED_LEN: usize = 44usize;
37086 pub const DEFAULT: Self = Self {
37087 roll: 0.0_f32,
37088 pitch: 0.0_f32,
37089 yaw: 0.0_f32,
37090 xacc: 0.0_f32,
37091 yacc: 0.0_f32,
37092 zacc: 0.0_f32,
37093 xgyro: 0.0_f32,
37094 ygyro: 0.0_f32,
37095 zgyro: 0.0_f32,
37096 lat: 0_i32,
37097 lng: 0_i32,
37098 };
37099 #[cfg(feature = "arbitrary")]
37100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37101 use arbitrary::{Arbitrary, Unstructured};
37102 let mut buf = [0u8; 1024];
37103 rng.fill_bytes(&mut buf);
37104 let mut unstructured = Unstructured::new(&buf);
37105 Self::arbitrary(&mut unstructured).unwrap_or_default()
37106 }
37107}
37108impl Default for SIMSTATE_DATA {
37109 fn default() -> Self {
37110 Self::DEFAULT.clone()
37111 }
37112}
37113impl MessageData for SIMSTATE_DATA {
37114 type Message = MavMessage;
37115 const ID: u32 = 164u32;
37116 const NAME: &'static str = "SIMSTATE";
37117 const EXTRA_CRC: u8 = 154u8;
37118 const ENCODED_LEN: usize = 44usize;
37119 fn deser(
37120 _version: MavlinkVersion,
37121 __input: &[u8],
37122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37123 let avail_len = __input.len();
37124 let mut payload_buf = [0; Self::ENCODED_LEN];
37125 let mut buf = if avail_len < Self::ENCODED_LEN {
37126 payload_buf[0..avail_len].copy_from_slice(__input);
37127 Bytes::new(&payload_buf)
37128 } else {
37129 Bytes::new(__input)
37130 };
37131 let mut __struct = Self::default();
37132 __struct.roll = buf.get_f32_le();
37133 __struct.pitch = buf.get_f32_le();
37134 __struct.yaw = buf.get_f32_le();
37135 __struct.xacc = buf.get_f32_le();
37136 __struct.yacc = buf.get_f32_le();
37137 __struct.zacc = buf.get_f32_le();
37138 __struct.xgyro = buf.get_f32_le();
37139 __struct.ygyro = buf.get_f32_le();
37140 __struct.zgyro = buf.get_f32_le();
37141 __struct.lat = buf.get_i32_le();
37142 __struct.lng = buf.get_i32_le();
37143 Ok(__struct)
37144 }
37145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37146 let mut __tmp = BytesMut::new(bytes);
37147 #[allow(clippy::absurd_extreme_comparisons)]
37148 #[allow(unused_comparisons)]
37149 if __tmp.remaining() < Self::ENCODED_LEN {
37150 panic!(
37151 "buffer is too small (need {} bytes, but got {})",
37152 Self::ENCODED_LEN,
37153 __tmp.remaining(),
37154 )
37155 }
37156 __tmp.put_f32_le(self.roll);
37157 __tmp.put_f32_le(self.pitch);
37158 __tmp.put_f32_le(self.yaw);
37159 __tmp.put_f32_le(self.xacc);
37160 __tmp.put_f32_le(self.yacc);
37161 __tmp.put_f32_le(self.zacc);
37162 __tmp.put_f32_le(self.xgyro);
37163 __tmp.put_f32_le(self.ygyro);
37164 __tmp.put_f32_le(self.zgyro);
37165 __tmp.put_i32_le(self.lat);
37166 __tmp.put_i32_le(self.lng);
37167 if matches!(version, MavlinkVersion::V2) {
37168 let len = __tmp.len();
37169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37170 } else {
37171 __tmp.len()
37172 }
37173 }
37174}
37175#[doc = "id: 108"]
37176#[doc = "Status of simulation environment, if used."]
37177#[derive(Debug, Clone, PartialEq)]
37178#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37180pub struct SIM_STATE_DATA {
37181 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
37182 pub q1: f32,
37183 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
37184 pub q2: f32,
37185 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
37186 pub q3: f32,
37187 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
37188 pub q4: f32,
37189 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
37190 pub roll: f32,
37191 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
37192 pub pitch: f32,
37193 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
37194 pub yaw: f32,
37195 #[doc = "X acceleration"]
37196 pub xacc: f32,
37197 #[doc = "Y acceleration"]
37198 pub yacc: f32,
37199 #[doc = "Z acceleration"]
37200 pub zacc: f32,
37201 #[doc = "Angular speed around X axis"]
37202 pub xgyro: f32,
37203 #[doc = "Angular speed around Y axis"]
37204 pub ygyro: f32,
37205 #[doc = "Angular speed around Z axis"]
37206 pub zgyro: f32,
37207 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
37208 pub lat: f32,
37209 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
37210 pub lon: f32,
37211 #[doc = "Altitude"]
37212 pub alt: f32,
37213 #[doc = "Horizontal position standard deviation"]
37214 pub std_dev_horz: f32,
37215 #[doc = "Vertical position standard deviation"]
37216 pub std_dev_vert: f32,
37217 #[doc = "True velocity in north direction in earth-fixed NED frame"]
37218 pub vn: f32,
37219 #[doc = "True velocity in east direction in earth-fixed NED frame"]
37220 pub ve: f32,
37221 #[doc = "True velocity in down direction in earth-fixed NED frame"]
37222 pub vd: f32,
37223 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
37224 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37225 pub lat_int: i32,
37226 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
37227 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37228 pub lon_int: i32,
37229}
37230impl SIM_STATE_DATA {
37231 pub const ENCODED_LEN: usize = 92usize;
37232 pub const DEFAULT: Self = Self {
37233 q1: 0.0_f32,
37234 q2: 0.0_f32,
37235 q3: 0.0_f32,
37236 q4: 0.0_f32,
37237 roll: 0.0_f32,
37238 pitch: 0.0_f32,
37239 yaw: 0.0_f32,
37240 xacc: 0.0_f32,
37241 yacc: 0.0_f32,
37242 zacc: 0.0_f32,
37243 xgyro: 0.0_f32,
37244 ygyro: 0.0_f32,
37245 zgyro: 0.0_f32,
37246 lat: 0.0_f32,
37247 lon: 0.0_f32,
37248 alt: 0.0_f32,
37249 std_dev_horz: 0.0_f32,
37250 std_dev_vert: 0.0_f32,
37251 vn: 0.0_f32,
37252 ve: 0.0_f32,
37253 vd: 0.0_f32,
37254 lat_int: 0_i32,
37255 lon_int: 0_i32,
37256 };
37257 #[cfg(feature = "arbitrary")]
37258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37259 use arbitrary::{Arbitrary, Unstructured};
37260 let mut buf = [0u8; 1024];
37261 rng.fill_bytes(&mut buf);
37262 let mut unstructured = Unstructured::new(&buf);
37263 Self::arbitrary(&mut unstructured).unwrap_or_default()
37264 }
37265}
37266impl Default for SIM_STATE_DATA {
37267 fn default() -> Self {
37268 Self::DEFAULT.clone()
37269 }
37270}
37271impl MessageData for SIM_STATE_DATA {
37272 type Message = MavMessage;
37273 const ID: u32 = 108u32;
37274 const NAME: &'static str = "SIM_STATE";
37275 const EXTRA_CRC: u8 = 32u8;
37276 const ENCODED_LEN: usize = 92usize;
37277 fn deser(
37278 _version: MavlinkVersion,
37279 __input: &[u8],
37280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37281 let avail_len = __input.len();
37282 let mut payload_buf = [0; Self::ENCODED_LEN];
37283 let mut buf = if avail_len < Self::ENCODED_LEN {
37284 payload_buf[0..avail_len].copy_from_slice(__input);
37285 Bytes::new(&payload_buf)
37286 } else {
37287 Bytes::new(__input)
37288 };
37289 let mut __struct = Self::default();
37290 __struct.q1 = buf.get_f32_le();
37291 __struct.q2 = buf.get_f32_le();
37292 __struct.q3 = buf.get_f32_le();
37293 __struct.q4 = buf.get_f32_le();
37294 __struct.roll = buf.get_f32_le();
37295 __struct.pitch = buf.get_f32_le();
37296 __struct.yaw = buf.get_f32_le();
37297 __struct.xacc = buf.get_f32_le();
37298 __struct.yacc = buf.get_f32_le();
37299 __struct.zacc = buf.get_f32_le();
37300 __struct.xgyro = buf.get_f32_le();
37301 __struct.ygyro = buf.get_f32_le();
37302 __struct.zgyro = buf.get_f32_le();
37303 __struct.lat = buf.get_f32_le();
37304 __struct.lon = buf.get_f32_le();
37305 __struct.alt = buf.get_f32_le();
37306 __struct.std_dev_horz = buf.get_f32_le();
37307 __struct.std_dev_vert = buf.get_f32_le();
37308 __struct.vn = buf.get_f32_le();
37309 __struct.ve = buf.get_f32_le();
37310 __struct.vd = buf.get_f32_le();
37311 __struct.lat_int = buf.get_i32_le();
37312 __struct.lon_int = buf.get_i32_le();
37313 Ok(__struct)
37314 }
37315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37316 let mut __tmp = BytesMut::new(bytes);
37317 #[allow(clippy::absurd_extreme_comparisons)]
37318 #[allow(unused_comparisons)]
37319 if __tmp.remaining() < Self::ENCODED_LEN {
37320 panic!(
37321 "buffer is too small (need {} bytes, but got {})",
37322 Self::ENCODED_LEN,
37323 __tmp.remaining(),
37324 )
37325 }
37326 __tmp.put_f32_le(self.q1);
37327 __tmp.put_f32_le(self.q2);
37328 __tmp.put_f32_le(self.q3);
37329 __tmp.put_f32_le(self.q4);
37330 __tmp.put_f32_le(self.roll);
37331 __tmp.put_f32_le(self.pitch);
37332 __tmp.put_f32_le(self.yaw);
37333 __tmp.put_f32_le(self.xacc);
37334 __tmp.put_f32_le(self.yacc);
37335 __tmp.put_f32_le(self.zacc);
37336 __tmp.put_f32_le(self.xgyro);
37337 __tmp.put_f32_le(self.ygyro);
37338 __tmp.put_f32_le(self.zgyro);
37339 __tmp.put_f32_le(self.lat);
37340 __tmp.put_f32_le(self.lon);
37341 __tmp.put_f32_le(self.alt);
37342 __tmp.put_f32_le(self.std_dev_horz);
37343 __tmp.put_f32_le(self.std_dev_vert);
37344 __tmp.put_f32_le(self.vn);
37345 __tmp.put_f32_le(self.ve);
37346 __tmp.put_f32_le(self.vd);
37347 __tmp.put_i32_le(self.lat_int);
37348 __tmp.put_i32_le(self.lon_int);
37349 if matches!(version, MavlinkVersion::V2) {
37350 let len = __tmp.len();
37351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37352 } else {
37353 __tmp.len()
37354 }
37355 }
37356}
37357#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
37358#[doc = "id: 370"]
37359#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
37360#[derive(Debug, Clone, PartialEq)]
37361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37363pub struct SMART_BATTERY_INFO_DATA {
37364 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
37365 pub capacity_full_specification: i32,
37366 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
37367 pub capacity_full: i32,
37368 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
37369 pub cycle_count: u16,
37370 #[doc = "Battery weight. 0: field not provided."]
37371 pub weight: u16,
37372 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
37373 pub discharge_minimum_voltage: u16,
37374 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
37375 pub charging_minimum_voltage: u16,
37376 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
37377 pub resting_minimum_voltage: u16,
37378 #[doc = "Battery ID"]
37379 pub id: u8,
37380 #[doc = "Function of the battery"]
37381 pub battery_function: MavBatteryFunction,
37382 #[doc = "Type (chemistry) of the battery"]
37383 pub mavtype: MavBatteryType,
37384 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
37385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
37386 pub serial_number: [u8; 16],
37387 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
37388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
37389 pub device_name: [u8; 50],
37390 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
37391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37392 pub charging_maximum_voltage: u16,
37393 #[doc = "Number of battery cells in series. 0: field not provided."]
37394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37395 pub cells_in_series: u8,
37396 #[doc = "Maximum pack discharge current. 0: field not provided."]
37397 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37398 pub discharge_maximum_current: u32,
37399 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
37400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37401 pub discharge_maximum_burst_current: u32,
37402 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
37403 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37404 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
37405 pub manufacture_date: [u8; 11],
37406}
37407impl SMART_BATTERY_INFO_DATA {
37408 pub const ENCODED_LEN: usize = 109usize;
37409 pub const DEFAULT: Self = Self {
37410 capacity_full_specification: 0_i32,
37411 capacity_full: 0_i32,
37412 cycle_count: 0_u16,
37413 weight: 0_u16,
37414 discharge_minimum_voltage: 0_u16,
37415 charging_minimum_voltage: 0_u16,
37416 resting_minimum_voltage: 0_u16,
37417 id: 0_u8,
37418 battery_function: MavBatteryFunction::DEFAULT,
37419 mavtype: MavBatteryType::DEFAULT,
37420 serial_number: [0_u8; 16usize],
37421 device_name: [0_u8; 50usize],
37422 charging_maximum_voltage: 0_u16,
37423 cells_in_series: 0_u8,
37424 discharge_maximum_current: 0_u32,
37425 discharge_maximum_burst_current: 0_u32,
37426 manufacture_date: [0_u8; 11usize],
37427 };
37428 #[cfg(feature = "arbitrary")]
37429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37430 use arbitrary::{Arbitrary, Unstructured};
37431 let mut buf = [0u8; 1024];
37432 rng.fill_bytes(&mut buf);
37433 let mut unstructured = Unstructured::new(&buf);
37434 Self::arbitrary(&mut unstructured).unwrap_or_default()
37435 }
37436}
37437impl Default for SMART_BATTERY_INFO_DATA {
37438 fn default() -> Self {
37439 Self::DEFAULT.clone()
37440 }
37441}
37442impl MessageData for SMART_BATTERY_INFO_DATA {
37443 type Message = MavMessage;
37444 const ID: u32 = 370u32;
37445 const NAME: &'static str = "SMART_BATTERY_INFO";
37446 const EXTRA_CRC: u8 = 75u8;
37447 const ENCODED_LEN: usize = 109usize;
37448 fn deser(
37449 _version: MavlinkVersion,
37450 __input: &[u8],
37451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37452 let avail_len = __input.len();
37453 let mut payload_buf = [0; Self::ENCODED_LEN];
37454 let mut buf = if avail_len < Self::ENCODED_LEN {
37455 payload_buf[0..avail_len].copy_from_slice(__input);
37456 Bytes::new(&payload_buf)
37457 } else {
37458 Bytes::new(__input)
37459 };
37460 let mut __struct = Self::default();
37461 __struct.capacity_full_specification = buf.get_i32_le();
37462 __struct.capacity_full = buf.get_i32_le();
37463 __struct.cycle_count = buf.get_u16_le();
37464 __struct.weight = buf.get_u16_le();
37465 __struct.discharge_minimum_voltage = buf.get_u16_le();
37466 __struct.charging_minimum_voltage = buf.get_u16_le();
37467 __struct.resting_minimum_voltage = buf.get_u16_le();
37468 __struct.id = buf.get_u8();
37469 let tmp = buf.get_u8();
37470 __struct.battery_function =
37471 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37472 enum_type: "MavBatteryFunction",
37473 value: tmp as u32,
37474 })?;
37475 let tmp = buf.get_u8();
37476 __struct.mavtype =
37477 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37478 enum_type: "MavBatteryType",
37479 value: tmp as u32,
37480 })?;
37481 for v in &mut __struct.serial_number {
37482 let val = buf.get_u8();
37483 *v = val;
37484 }
37485 for v in &mut __struct.device_name {
37486 let val = buf.get_u8();
37487 *v = val;
37488 }
37489 __struct.charging_maximum_voltage = buf.get_u16_le();
37490 __struct.cells_in_series = buf.get_u8();
37491 __struct.discharge_maximum_current = buf.get_u32_le();
37492 __struct.discharge_maximum_burst_current = buf.get_u32_le();
37493 for v in &mut __struct.manufacture_date {
37494 let val = buf.get_u8();
37495 *v = val;
37496 }
37497 Ok(__struct)
37498 }
37499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37500 let mut __tmp = BytesMut::new(bytes);
37501 #[allow(clippy::absurd_extreme_comparisons)]
37502 #[allow(unused_comparisons)]
37503 if __tmp.remaining() < Self::ENCODED_LEN {
37504 panic!(
37505 "buffer is too small (need {} bytes, but got {})",
37506 Self::ENCODED_LEN,
37507 __tmp.remaining(),
37508 )
37509 }
37510 __tmp.put_i32_le(self.capacity_full_specification);
37511 __tmp.put_i32_le(self.capacity_full);
37512 __tmp.put_u16_le(self.cycle_count);
37513 __tmp.put_u16_le(self.weight);
37514 __tmp.put_u16_le(self.discharge_minimum_voltage);
37515 __tmp.put_u16_le(self.charging_minimum_voltage);
37516 __tmp.put_u16_le(self.resting_minimum_voltage);
37517 __tmp.put_u8(self.id);
37518 __tmp.put_u8(self.battery_function as u8);
37519 __tmp.put_u8(self.mavtype as u8);
37520 for val in &self.serial_number {
37521 __tmp.put_u8(*val);
37522 }
37523 for val in &self.device_name {
37524 __tmp.put_u8(*val);
37525 }
37526 __tmp.put_u16_le(self.charging_maximum_voltage);
37527 __tmp.put_u8(self.cells_in_series);
37528 __tmp.put_u32_le(self.discharge_maximum_current);
37529 __tmp.put_u32_le(self.discharge_maximum_burst_current);
37530 for val in &self.manufacture_date {
37531 __tmp.put_u8(*val);
37532 }
37533 if matches!(version, MavlinkVersion::V2) {
37534 let len = __tmp.len();
37535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37536 } else {
37537 __tmp.len()
37538 }
37539 }
37540}
37541#[doc = "id: 253"]
37542#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
37543#[derive(Debug, Clone, PartialEq)]
37544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37546pub struct STATUSTEXT_DATA {
37547 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
37548 pub severity: MavSeverity,
37549 #[doc = "Status text message, without null termination character"]
37550 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
37551 pub text: [u8; 50],
37552 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
37553 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37554 pub id: u16,
37555 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
37556 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37557 pub chunk_seq: u8,
37558}
37559impl STATUSTEXT_DATA {
37560 pub const ENCODED_LEN: usize = 54usize;
37561 pub const DEFAULT: Self = Self {
37562 severity: MavSeverity::DEFAULT,
37563 text: [0_u8; 50usize],
37564 id: 0_u16,
37565 chunk_seq: 0_u8,
37566 };
37567 #[cfg(feature = "arbitrary")]
37568 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37569 use arbitrary::{Arbitrary, Unstructured};
37570 let mut buf = [0u8; 1024];
37571 rng.fill_bytes(&mut buf);
37572 let mut unstructured = Unstructured::new(&buf);
37573 Self::arbitrary(&mut unstructured).unwrap_or_default()
37574 }
37575}
37576impl Default for STATUSTEXT_DATA {
37577 fn default() -> Self {
37578 Self::DEFAULT.clone()
37579 }
37580}
37581impl MessageData for STATUSTEXT_DATA {
37582 type Message = MavMessage;
37583 const ID: u32 = 253u32;
37584 const NAME: &'static str = "STATUSTEXT";
37585 const EXTRA_CRC: u8 = 83u8;
37586 const ENCODED_LEN: usize = 54usize;
37587 fn deser(
37588 _version: MavlinkVersion,
37589 __input: &[u8],
37590 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37591 let avail_len = __input.len();
37592 let mut payload_buf = [0; Self::ENCODED_LEN];
37593 let mut buf = if avail_len < Self::ENCODED_LEN {
37594 payload_buf[0..avail_len].copy_from_slice(__input);
37595 Bytes::new(&payload_buf)
37596 } else {
37597 Bytes::new(__input)
37598 };
37599 let mut __struct = Self::default();
37600 let tmp = buf.get_u8();
37601 __struct.severity =
37602 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37603 enum_type: "MavSeverity",
37604 value: tmp as u32,
37605 })?;
37606 for v in &mut __struct.text {
37607 let val = buf.get_u8();
37608 *v = val;
37609 }
37610 __struct.id = buf.get_u16_le();
37611 __struct.chunk_seq = buf.get_u8();
37612 Ok(__struct)
37613 }
37614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37615 let mut __tmp = BytesMut::new(bytes);
37616 #[allow(clippy::absurd_extreme_comparisons)]
37617 #[allow(unused_comparisons)]
37618 if __tmp.remaining() < Self::ENCODED_LEN {
37619 panic!(
37620 "buffer is too small (need {} bytes, but got {})",
37621 Self::ENCODED_LEN,
37622 __tmp.remaining(),
37623 )
37624 }
37625 __tmp.put_u8(self.severity as u8);
37626 for val in &self.text {
37627 __tmp.put_u8(*val);
37628 }
37629 __tmp.put_u16_le(self.id);
37630 __tmp.put_u8(self.chunk_seq);
37631 if matches!(version, MavlinkVersion::V2) {
37632 let len = __tmp.len();
37633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37634 } else {
37635 __tmp.len()
37636 }
37637 }
37638}
37639#[doc = "id: 261"]
37640#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
37641#[derive(Debug, Clone, PartialEq)]
37642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37644pub struct STORAGE_INFORMATION_DATA {
37645 #[doc = "Timestamp (time since system boot)."]
37646 pub time_boot_ms: u32,
37647 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
37648 pub total_capacity: f32,
37649 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
37650 pub used_capacity: f32,
37651 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
37652 pub available_capacity: f32,
37653 #[doc = "Read speed."]
37654 pub read_speed: f32,
37655 #[doc = "Write speed."]
37656 pub write_speed: f32,
37657 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
37658 pub storage_id: u8,
37659 #[doc = "Number of storage devices"]
37660 pub storage_count: u8,
37661 #[doc = "Status of storage"]
37662 pub status: StorageStatus,
37663 #[doc = "Type of storage"]
37664 #[cfg_attr(feature = "serde", serde(default))]
37665 pub mavtype: StorageType,
37666 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
37667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
37668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
37669 pub name: [u8; 32],
37670 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
37671 #[cfg_attr(feature = "serde", serde(default))]
37672 pub storage_usage: StorageUsageFlag,
37673}
37674impl STORAGE_INFORMATION_DATA {
37675 pub const ENCODED_LEN: usize = 61usize;
37676 pub const DEFAULT: Self = Self {
37677 time_boot_ms: 0_u32,
37678 total_capacity: 0.0_f32,
37679 used_capacity: 0.0_f32,
37680 available_capacity: 0.0_f32,
37681 read_speed: 0.0_f32,
37682 write_speed: 0.0_f32,
37683 storage_id: 0_u8,
37684 storage_count: 0_u8,
37685 status: StorageStatus::DEFAULT,
37686 mavtype: StorageType::DEFAULT,
37687 name: [0_u8; 32usize],
37688 storage_usage: StorageUsageFlag::DEFAULT,
37689 };
37690 #[cfg(feature = "arbitrary")]
37691 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37692 use arbitrary::{Arbitrary, Unstructured};
37693 let mut buf = [0u8; 1024];
37694 rng.fill_bytes(&mut buf);
37695 let mut unstructured = Unstructured::new(&buf);
37696 Self::arbitrary(&mut unstructured).unwrap_or_default()
37697 }
37698}
37699impl Default for STORAGE_INFORMATION_DATA {
37700 fn default() -> Self {
37701 Self::DEFAULT.clone()
37702 }
37703}
37704impl MessageData for STORAGE_INFORMATION_DATA {
37705 type Message = MavMessage;
37706 const ID: u32 = 261u32;
37707 const NAME: &'static str = "STORAGE_INFORMATION";
37708 const EXTRA_CRC: u8 = 179u8;
37709 const ENCODED_LEN: usize = 61usize;
37710 fn deser(
37711 _version: MavlinkVersion,
37712 __input: &[u8],
37713 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37714 let avail_len = __input.len();
37715 let mut payload_buf = [0; Self::ENCODED_LEN];
37716 let mut buf = if avail_len < Self::ENCODED_LEN {
37717 payload_buf[0..avail_len].copy_from_slice(__input);
37718 Bytes::new(&payload_buf)
37719 } else {
37720 Bytes::new(__input)
37721 };
37722 let mut __struct = Self::default();
37723 __struct.time_boot_ms = buf.get_u32_le();
37724 __struct.total_capacity = buf.get_f32_le();
37725 __struct.used_capacity = buf.get_f32_le();
37726 __struct.available_capacity = buf.get_f32_le();
37727 __struct.read_speed = buf.get_f32_le();
37728 __struct.write_speed = buf.get_f32_le();
37729 __struct.storage_id = buf.get_u8();
37730 __struct.storage_count = buf.get_u8();
37731 let tmp = buf.get_u8();
37732 __struct.status =
37733 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37734 enum_type: "StorageStatus",
37735 value: tmp as u32,
37736 })?;
37737 let tmp = buf.get_u8();
37738 __struct.mavtype =
37739 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
37740 enum_type: "StorageType",
37741 value: tmp as u32,
37742 })?;
37743 for v in &mut __struct.name {
37744 let val = buf.get_u8();
37745 *v = val;
37746 }
37747 let tmp = buf.get_u8();
37748 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
37749 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
37750 flag_type: "StorageUsageFlag",
37751 value: tmp as u32,
37752 })?;
37753 Ok(__struct)
37754 }
37755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37756 let mut __tmp = BytesMut::new(bytes);
37757 #[allow(clippy::absurd_extreme_comparisons)]
37758 #[allow(unused_comparisons)]
37759 if __tmp.remaining() < Self::ENCODED_LEN {
37760 panic!(
37761 "buffer is too small (need {} bytes, but got {})",
37762 Self::ENCODED_LEN,
37763 __tmp.remaining(),
37764 )
37765 }
37766 __tmp.put_u32_le(self.time_boot_ms);
37767 __tmp.put_f32_le(self.total_capacity);
37768 __tmp.put_f32_le(self.used_capacity);
37769 __tmp.put_f32_le(self.available_capacity);
37770 __tmp.put_f32_le(self.read_speed);
37771 __tmp.put_f32_le(self.write_speed);
37772 __tmp.put_u8(self.storage_id);
37773 __tmp.put_u8(self.storage_count);
37774 __tmp.put_u8(self.status as u8);
37775 __tmp.put_u8(self.mavtype as u8);
37776 for val in &self.name {
37777 __tmp.put_u8(*val);
37778 }
37779 __tmp.put_u8(self.storage_usage.bits());
37780 if matches!(version, MavlinkVersion::V2) {
37781 let len = __tmp.len();
37782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37783 } else {
37784 __tmp.len()
37785 }
37786 }
37787}
37788#[doc = "id: 401"]
37789#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
37790#[derive(Debug, Clone, PartialEq)]
37791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37793pub struct SUPPORTED_TUNES_DATA {
37794 #[doc = "Bitfield of supported tune formats."]
37795 pub format: TuneFormat,
37796 #[doc = "System ID"]
37797 pub target_system: u8,
37798 #[doc = "Component ID"]
37799 pub target_component: u8,
37800}
37801impl SUPPORTED_TUNES_DATA {
37802 pub const ENCODED_LEN: usize = 6usize;
37803 pub const DEFAULT: Self = Self {
37804 format: TuneFormat::DEFAULT,
37805 target_system: 0_u8,
37806 target_component: 0_u8,
37807 };
37808 #[cfg(feature = "arbitrary")]
37809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37810 use arbitrary::{Arbitrary, Unstructured};
37811 let mut buf = [0u8; 1024];
37812 rng.fill_bytes(&mut buf);
37813 let mut unstructured = Unstructured::new(&buf);
37814 Self::arbitrary(&mut unstructured).unwrap_or_default()
37815 }
37816}
37817impl Default for SUPPORTED_TUNES_DATA {
37818 fn default() -> Self {
37819 Self::DEFAULT.clone()
37820 }
37821}
37822impl MessageData for SUPPORTED_TUNES_DATA {
37823 type Message = MavMessage;
37824 const ID: u32 = 401u32;
37825 const NAME: &'static str = "SUPPORTED_TUNES";
37826 const EXTRA_CRC: u8 = 183u8;
37827 const ENCODED_LEN: usize = 6usize;
37828 fn deser(
37829 _version: MavlinkVersion,
37830 __input: &[u8],
37831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37832 let avail_len = __input.len();
37833 let mut payload_buf = [0; Self::ENCODED_LEN];
37834 let mut buf = if avail_len < Self::ENCODED_LEN {
37835 payload_buf[0..avail_len].copy_from_slice(__input);
37836 Bytes::new(&payload_buf)
37837 } else {
37838 Bytes::new(__input)
37839 };
37840 let mut __struct = Self::default();
37841 let tmp = buf.get_u32_le();
37842 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
37843 ::mavlink_core::error::ParserError::InvalidEnum {
37844 enum_type: "TuneFormat",
37845 value: tmp as u32,
37846 },
37847 )?;
37848 __struct.target_system = buf.get_u8();
37849 __struct.target_component = buf.get_u8();
37850 Ok(__struct)
37851 }
37852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37853 let mut __tmp = BytesMut::new(bytes);
37854 #[allow(clippy::absurd_extreme_comparisons)]
37855 #[allow(unused_comparisons)]
37856 if __tmp.remaining() < Self::ENCODED_LEN {
37857 panic!(
37858 "buffer is too small (need {} bytes, but got {})",
37859 Self::ENCODED_LEN,
37860 __tmp.remaining(),
37861 )
37862 }
37863 __tmp.put_u32_le(self.format as u32);
37864 __tmp.put_u8(self.target_system);
37865 __tmp.put_u8(self.target_component);
37866 if matches!(version, MavlinkVersion::V2) {
37867 let len = __tmp.len();
37868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37869 } else {
37870 __tmp.len()
37871 }
37872 }
37873}
37874#[doc = "id: 2"]
37875#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
37876#[derive(Debug, Clone, PartialEq)]
37877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37879pub struct SYSTEM_TIME_DATA {
37880 #[doc = "Timestamp (UNIX epoch time)."]
37881 pub time_unix_usec: u64,
37882 #[doc = "Timestamp (time since system boot)."]
37883 pub time_boot_ms: u32,
37884}
37885impl SYSTEM_TIME_DATA {
37886 pub const ENCODED_LEN: usize = 12usize;
37887 pub const DEFAULT: Self = Self {
37888 time_unix_usec: 0_u64,
37889 time_boot_ms: 0_u32,
37890 };
37891 #[cfg(feature = "arbitrary")]
37892 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
37893 use arbitrary::{Arbitrary, Unstructured};
37894 let mut buf = [0u8; 1024];
37895 rng.fill_bytes(&mut buf);
37896 let mut unstructured = Unstructured::new(&buf);
37897 Self::arbitrary(&mut unstructured).unwrap_or_default()
37898 }
37899}
37900impl Default for SYSTEM_TIME_DATA {
37901 fn default() -> Self {
37902 Self::DEFAULT.clone()
37903 }
37904}
37905impl MessageData for SYSTEM_TIME_DATA {
37906 type Message = MavMessage;
37907 const ID: u32 = 2u32;
37908 const NAME: &'static str = "SYSTEM_TIME";
37909 const EXTRA_CRC: u8 = 137u8;
37910 const ENCODED_LEN: usize = 12usize;
37911 fn deser(
37912 _version: MavlinkVersion,
37913 __input: &[u8],
37914 ) -> Result<Self, ::mavlink_core::error::ParserError> {
37915 let avail_len = __input.len();
37916 let mut payload_buf = [0; Self::ENCODED_LEN];
37917 let mut buf = if avail_len < Self::ENCODED_LEN {
37918 payload_buf[0..avail_len].copy_from_slice(__input);
37919 Bytes::new(&payload_buf)
37920 } else {
37921 Bytes::new(__input)
37922 };
37923 let mut __struct = Self::default();
37924 __struct.time_unix_usec = buf.get_u64_le();
37925 __struct.time_boot_ms = buf.get_u32_le();
37926 Ok(__struct)
37927 }
37928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37929 let mut __tmp = BytesMut::new(bytes);
37930 #[allow(clippy::absurd_extreme_comparisons)]
37931 #[allow(unused_comparisons)]
37932 if __tmp.remaining() < Self::ENCODED_LEN {
37933 panic!(
37934 "buffer is too small (need {} bytes, but got {})",
37935 Self::ENCODED_LEN,
37936 __tmp.remaining(),
37937 )
37938 }
37939 __tmp.put_u64_le(self.time_unix_usec);
37940 __tmp.put_u32_le(self.time_boot_ms);
37941 if matches!(version, MavlinkVersion::V2) {
37942 let len = __tmp.len();
37943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
37944 } else {
37945 __tmp.len()
37946 }
37947 }
37948}
37949#[doc = "id: 1"]
37950#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
37951#[derive(Debug, Clone, PartialEq)]
37952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
37953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
37954pub struct SYS_STATUS_DATA {
37955 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
37956 pub onboard_control_sensors_present: MavSysStatusSensor,
37957 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
37958 pub onboard_control_sensors_enabled: MavSysStatusSensor,
37959 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
37960 pub onboard_control_sensors_health: MavSysStatusSensor,
37961 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
37962 pub load: u16,
37963 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
37964 pub voltage_battery: u16,
37965 #[doc = "Battery current, -1: Current not sent by autopilot"]
37966 pub current_battery: i16,
37967 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
37968 pub drop_rate_comm: u16,
37969 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
37970 pub errors_comm: u16,
37971 #[doc = "Autopilot-specific errors"]
37972 pub errors_count1: u16,
37973 #[doc = "Autopilot-specific errors"]
37974 pub errors_count2: u16,
37975 #[doc = "Autopilot-specific errors"]
37976 pub errors_count3: u16,
37977 #[doc = "Autopilot-specific errors"]
37978 pub errors_count4: u16,
37979 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
37980 pub battery_remaining: i8,
37981 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
37982 #[cfg_attr(feature = "serde", serde(default))]
37983 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
37984 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
37985 #[cfg_attr(feature = "serde", serde(default))]
37986 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
37987 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
37988 #[cfg_attr(feature = "serde", serde(default))]
37989 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
37990}
37991impl SYS_STATUS_DATA {
37992 pub const ENCODED_LEN: usize = 43usize;
37993 pub const DEFAULT: Self = Self {
37994 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
37995 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
37996 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
37997 load: 0_u16,
37998 voltage_battery: 0_u16,
37999 current_battery: 0_i16,
38000 drop_rate_comm: 0_u16,
38001 errors_comm: 0_u16,
38002 errors_count1: 0_u16,
38003 errors_count2: 0_u16,
38004 errors_count3: 0_u16,
38005 errors_count4: 0_u16,
38006 battery_remaining: 0_i8,
38007 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
38008 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
38009 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
38010 };
38011 #[cfg(feature = "arbitrary")]
38012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38013 use arbitrary::{Arbitrary, Unstructured};
38014 let mut buf = [0u8; 1024];
38015 rng.fill_bytes(&mut buf);
38016 let mut unstructured = Unstructured::new(&buf);
38017 Self::arbitrary(&mut unstructured).unwrap_or_default()
38018 }
38019}
38020impl Default for SYS_STATUS_DATA {
38021 fn default() -> Self {
38022 Self::DEFAULT.clone()
38023 }
38024}
38025impl MessageData for SYS_STATUS_DATA {
38026 type Message = MavMessage;
38027 const ID: u32 = 1u32;
38028 const NAME: &'static str = "SYS_STATUS";
38029 const EXTRA_CRC: u8 = 124u8;
38030 const ENCODED_LEN: usize = 43usize;
38031 fn deser(
38032 _version: MavlinkVersion,
38033 __input: &[u8],
38034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38035 let avail_len = __input.len();
38036 let mut payload_buf = [0; Self::ENCODED_LEN];
38037 let mut buf = if avail_len < Self::ENCODED_LEN {
38038 payload_buf[0..avail_len].copy_from_slice(__input);
38039 Bytes::new(&payload_buf)
38040 } else {
38041 Bytes::new(__input)
38042 };
38043 let mut __struct = Self::default();
38044 let tmp = buf.get_u32_le();
38045 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
38046 tmp & MavSysStatusSensor::all().bits(),
38047 )
38048 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38049 flag_type: "MavSysStatusSensor",
38050 value: tmp as u32,
38051 })?;
38052 let tmp = buf.get_u32_le();
38053 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
38054 tmp & MavSysStatusSensor::all().bits(),
38055 )
38056 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38057 flag_type: "MavSysStatusSensor",
38058 value: tmp as u32,
38059 })?;
38060 let tmp = buf.get_u32_le();
38061 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
38062 tmp & MavSysStatusSensor::all().bits(),
38063 )
38064 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38065 flag_type: "MavSysStatusSensor",
38066 value: tmp as u32,
38067 })?;
38068 __struct.load = buf.get_u16_le();
38069 __struct.voltage_battery = buf.get_u16_le();
38070 __struct.current_battery = buf.get_i16_le();
38071 __struct.drop_rate_comm = buf.get_u16_le();
38072 __struct.errors_comm = buf.get_u16_le();
38073 __struct.errors_count1 = buf.get_u16_le();
38074 __struct.errors_count2 = buf.get_u16_le();
38075 __struct.errors_count3 = buf.get_u16_le();
38076 __struct.errors_count4 = buf.get_u16_le();
38077 __struct.battery_remaining = buf.get_i8();
38078 let tmp = buf.get_u32_le();
38079 __struct.onboard_control_sensors_present_extended =
38080 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
38081 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38082 flag_type: "MavSysStatusSensorExtended",
38083 value: tmp as u32,
38084 })?;
38085 let tmp = buf.get_u32_le();
38086 __struct.onboard_control_sensors_enabled_extended =
38087 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
38088 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38089 flag_type: "MavSysStatusSensorExtended",
38090 value: tmp as u32,
38091 })?;
38092 let tmp = buf.get_u32_le();
38093 __struct.onboard_control_sensors_health_extended =
38094 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
38095 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
38096 flag_type: "MavSysStatusSensorExtended",
38097 value: tmp as u32,
38098 })?;
38099 Ok(__struct)
38100 }
38101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38102 let mut __tmp = BytesMut::new(bytes);
38103 #[allow(clippy::absurd_extreme_comparisons)]
38104 #[allow(unused_comparisons)]
38105 if __tmp.remaining() < Self::ENCODED_LEN {
38106 panic!(
38107 "buffer is too small (need {} bytes, but got {})",
38108 Self::ENCODED_LEN,
38109 __tmp.remaining(),
38110 )
38111 }
38112 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
38113 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
38114 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
38115 __tmp.put_u16_le(self.load);
38116 __tmp.put_u16_le(self.voltage_battery);
38117 __tmp.put_i16_le(self.current_battery);
38118 __tmp.put_u16_le(self.drop_rate_comm);
38119 __tmp.put_u16_le(self.errors_comm);
38120 __tmp.put_u16_le(self.errors_count1);
38121 __tmp.put_u16_le(self.errors_count2);
38122 __tmp.put_u16_le(self.errors_count3);
38123 __tmp.put_u16_le(self.errors_count4);
38124 __tmp.put_i8(self.battery_remaining);
38125 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
38126 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
38127 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
38128 if matches!(version, MavlinkVersion::V2) {
38129 let len = __tmp.len();
38130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38131 } else {
38132 __tmp.len()
38133 }
38134 }
38135}
38136#[doc = "id: 135"]
38137#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
38138#[derive(Debug, Clone, PartialEq)]
38139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38141pub struct TERRAIN_CHECK_DATA {
38142 #[doc = "Latitude"]
38143 pub lat: i32,
38144 #[doc = "Longitude"]
38145 pub lon: i32,
38146}
38147impl TERRAIN_CHECK_DATA {
38148 pub const ENCODED_LEN: usize = 8usize;
38149 pub const DEFAULT: Self = Self {
38150 lat: 0_i32,
38151 lon: 0_i32,
38152 };
38153 #[cfg(feature = "arbitrary")]
38154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38155 use arbitrary::{Arbitrary, Unstructured};
38156 let mut buf = [0u8; 1024];
38157 rng.fill_bytes(&mut buf);
38158 let mut unstructured = Unstructured::new(&buf);
38159 Self::arbitrary(&mut unstructured).unwrap_or_default()
38160 }
38161}
38162impl Default for TERRAIN_CHECK_DATA {
38163 fn default() -> Self {
38164 Self::DEFAULT.clone()
38165 }
38166}
38167impl MessageData for TERRAIN_CHECK_DATA {
38168 type Message = MavMessage;
38169 const ID: u32 = 135u32;
38170 const NAME: &'static str = "TERRAIN_CHECK";
38171 const EXTRA_CRC: u8 = 203u8;
38172 const ENCODED_LEN: usize = 8usize;
38173 fn deser(
38174 _version: MavlinkVersion,
38175 __input: &[u8],
38176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38177 let avail_len = __input.len();
38178 let mut payload_buf = [0; Self::ENCODED_LEN];
38179 let mut buf = if avail_len < Self::ENCODED_LEN {
38180 payload_buf[0..avail_len].copy_from_slice(__input);
38181 Bytes::new(&payload_buf)
38182 } else {
38183 Bytes::new(__input)
38184 };
38185 let mut __struct = Self::default();
38186 __struct.lat = buf.get_i32_le();
38187 __struct.lon = buf.get_i32_le();
38188 Ok(__struct)
38189 }
38190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38191 let mut __tmp = BytesMut::new(bytes);
38192 #[allow(clippy::absurd_extreme_comparisons)]
38193 #[allow(unused_comparisons)]
38194 if __tmp.remaining() < Self::ENCODED_LEN {
38195 panic!(
38196 "buffer is too small (need {} bytes, but got {})",
38197 Self::ENCODED_LEN,
38198 __tmp.remaining(),
38199 )
38200 }
38201 __tmp.put_i32_le(self.lat);
38202 __tmp.put_i32_le(self.lon);
38203 if matches!(version, MavlinkVersion::V2) {
38204 let len = __tmp.len();
38205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38206 } else {
38207 __tmp.len()
38208 }
38209 }
38210}
38211#[doc = "id: 134"]
38212#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
38213#[derive(Debug, Clone, PartialEq)]
38214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38216pub struct TERRAIN_DATA_DATA {
38217 #[doc = "Latitude of SW corner of first grid"]
38218 pub lat: i32,
38219 #[doc = "Longitude of SW corner of first grid"]
38220 pub lon: i32,
38221 #[doc = "Grid spacing"]
38222 pub grid_spacing: u16,
38223 #[doc = "Terrain data MSL"]
38224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38225 pub data: [i16; 16],
38226 #[doc = "bit within the terrain request mask"]
38227 pub gridbit: u8,
38228}
38229impl TERRAIN_DATA_DATA {
38230 pub const ENCODED_LEN: usize = 43usize;
38231 pub const DEFAULT: Self = Self {
38232 lat: 0_i32,
38233 lon: 0_i32,
38234 grid_spacing: 0_u16,
38235 data: [0_i16; 16usize],
38236 gridbit: 0_u8,
38237 };
38238 #[cfg(feature = "arbitrary")]
38239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38240 use arbitrary::{Arbitrary, Unstructured};
38241 let mut buf = [0u8; 1024];
38242 rng.fill_bytes(&mut buf);
38243 let mut unstructured = Unstructured::new(&buf);
38244 Self::arbitrary(&mut unstructured).unwrap_or_default()
38245 }
38246}
38247impl Default for TERRAIN_DATA_DATA {
38248 fn default() -> Self {
38249 Self::DEFAULT.clone()
38250 }
38251}
38252impl MessageData for TERRAIN_DATA_DATA {
38253 type Message = MavMessage;
38254 const ID: u32 = 134u32;
38255 const NAME: &'static str = "TERRAIN_DATA";
38256 const EXTRA_CRC: u8 = 229u8;
38257 const ENCODED_LEN: usize = 43usize;
38258 fn deser(
38259 _version: MavlinkVersion,
38260 __input: &[u8],
38261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38262 let avail_len = __input.len();
38263 let mut payload_buf = [0; Self::ENCODED_LEN];
38264 let mut buf = if avail_len < Self::ENCODED_LEN {
38265 payload_buf[0..avail_len].copy_from_slice(__input);
38266 Bytes::new(&payload_buf)
38267 } else {
38268 Bytes::new(__input)
38269 };
38270 let mut __struct = Self::default();
38271 __struct.lat = buf.get_i32_le();
38272 __struct.lon = buf.get_i32_le();
38273 __struct.grid_spacing = buf.get_u16_le();
38274 for v in &mut __struct.data {
38275 let val = buf.get_i16_le();
38276 *v = val;
38277 }
38278 __struct.gridbit = buf.get_u8();
38279 Ok(__struct)
38280 }
38281 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38282 let mut __tmp = BytesMut::new(bytes);
38283 #[allow(clippy::absurd_extreme_comparisons)]
38284 #[allow(unused_comparisons)]
38285 if __tmp.remaining() < Self::ENCODED_LEN {
38286 panic!(
38287 "buffer is too small (need {} bytes, but got {})",
38288 Self::ENCODED_LEN,
38289 __tmp.remaining(),
38290 )
38291 }
38292 __tmp.put_i32_le(self.lat);
38293 __tmp.put_i32_le(self.lon);
38294 __tmp.put_u16_le(self.grid_spacing);
38295 for val in &self.data {
38296 __tmp.put_i16_le(*val);
38297 }
38298 __tmp.put_u8(self.gridbit);
38299 if matches!(version, MavlinkVersion::V2) {
38300 let len = __tmp.len();
38301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38302 } else {
38303 __tmp.len()
38304 }
38305 }
38306}
38307#[doc = "id: 136"]
38308#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
38309#[derive(Debug, Clone, PartialEq)]
38310#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38312pub struct TERRAIN_REPORT_DATA {
38313 #[doc = "Latitude"]
38314 pub lat: i32,
38315 #[doc = "Longitude"]
38316 pub lon: i32,
38317 #[doc = "Terrain height MSL"]
38318 pub terrain_height: f32,
38319 #[doc = "Current vehicle height above lat/lon terrain height"]
38320 pub current_height: f32,
38321 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
38322 pub spacing: u16,
38323 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
38324 pub pending: u16,
38325 #[doc = "Number of 4x4 terrain blocks in memory"]
38326 pub loaded: u16,
38327}
38328impl TERRAIN_REPORT_DATA {
38329 pub const ENCODED_LEN: usize = 22usize;
38330 pub const DEFAULT: Self = Self {
38331 lat: 0_i32,
38332 lon: 0_i32,
38333 terrain_height: 0.0_f32,
38334 current_height: 0.0_f32,
38335 spacing: 0_u16,
38336 pending: 0_u16,
38337 loaded: 0_u16,
38338 };
38339 #[cfg(feature = "arbitrary")]
38340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38341 use arbitrary::{Arbitrary, Unstructured};
38342 let mut buf = [0u8; 1024];
38343 rng.fill_bytes(&mut buf);
38344 let mut unstructured = Unstructured::new(&buf);
38345 Self::arbitrary(&mut unstructured).unwrap_or_default()
38346 }
38347}
38348impl Default for TERRAIN_REPORT_DATA {
38349 fn default() -> Self {
38350 Self::DEFAULT.clone()
38351 }
38352}
38353impl MessageData for TERRAIN_REPORT_DATA {
38354 type Message = MavMessage;
38355 const ID: u32 = 136u32;
38356 const NAME: &'static str = "TERRAIN_REPORT";
38357 const EXTRA_CRC: u8 = 1u8;
38358 const ENCODED_LEN: usize = 22usize;
38359 fn deser(
38360 _version: MavlinkVersion,
38361 __input: &[u8],
38362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38363 let avail_len = __input.len();
38364 let mut payload_buf = [0; Self::ENCODED_LEN];
38365 let mut buf = if avail_len < Self::ENCODED_LEN {
38366 payload_buf[0..avail_len].copy_from_slice(__input);
38367 Bytes::new(&payload_buf)
38368 } else {
38369 Bytes::new(__input)
38370 };
38371 let mut __struct = Self::default();
38372 __struct.lat = buf.get_i32_le();
38373 __struct.lon = buf.get_i32_le();
38374 __struct.terrain_height = buf.get_f32_le();
38375 __struct.current_height = buf.get_f32_le();
38376 __struct.spacing = buf.get_u16_le();
38377 __struct.pending = buf.get_u16_le();
38378 __struct.loaded = buf.get_u16_le();
38379 Ok(__struct)
38380 }
38381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38382 let mut __tmp = BytesMut::new(bytes);
38383 #[allow(clippy::absurd_extreme_comparisons)]
38384 #[allow(unused_comparisons)]
38385 if __tmp.remaining() < Self::ENCODED_LEN {
38386 panic!(
38387 "buffer is too small (need {} bytes, but got {})",
38388 Self::ENCODED_LEN,
38389 __tmp.remaining(),
38390 )
38391 }
38392 __tmp.put_i32_le(self.lat);
38393 __tmp.put_i32_le(self.lon);
38394 __tmp.put_f32_le(self.terrain_height);
38395 __tmp.put_f32_le(self.current_height);
38396 __tmp.put_u16_le(self.spacing);
38397 __tmp.put_u16_le(self.pending);
38398 __tmp.put_u16_le(self.loaded);
38399 if matches!(version, MavlinkVersion::V2) {
38400 let len = __tmp.len();
38401 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38402 } else {
38403 __tmp.len()
38404 }
38405 }
38406}
38407#[doc = "id: 133"]
38408#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
38409#[derive(Debug, Clone, PartialEq)]
38410#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38412pub struct TERRAIN_REQUEST_DATA {
38413 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
38414 pub mask: u64,
38415 #[doc = "Latitude of SW corner of first grid"]
38416 pub lat: i32,
38417 #[doc = "Longitude of SW corner of first grid"]
38418 pub lon: i32,
38419 #[doc = "Grid spacing"]
38420 pub grid_spacing: u16,
38421}
38422impl TERRAIN_REQUEST_DATA {
38423 pub const ENCODED_LEN: usize = 18usize;
38424 pub const DEFAULT: Self = Self {
38425 mask: 0_u64,
38426 lat: 0_i32,
38427 lon: 0_i32,
38428 grid_spacing: 0_u16,
38429 };
38430 #[cfg(feature = "arbitrary")]
38431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38432 use arbitrary::{Arbitrary, Unstructured};
38433 let mut buf = [0u8; 1024];
38434 rng.fill_bytes(&mut buf);
38435 let mut unstructured = Unstructured::new(&buf);
38436 Self::arbitrary(&mut unstructured).unwrap_or_default()
38437 }
38438}
38439impl Default for TERRAIN_REQUEST_DATA {
38440 fn default() -> Self {
38441 Self::DEFAULT.clone()
38442 }
38443}
38444impl MessageData for TERRAIN_REQUEST_DATA {
38445 type Message = MavMessage;
38446 const ID: u32 = 133u32;
38447 const NAME: &'static str = "TERRAIN_REQUEST";
38448 const EXTRA_CRC: u8 = 6u8;
38449 const ENCODED_LEN: usize = 18usize;
38450 fn deser(
38451 _version: MavlinkVersion,
38452 __input: &[u8],
38453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38454 let avail_len = __input.len();
38455 let mut payload_buf = [0; Self::ENCODED_LEN];
38456 let mut buf = if avail_len < Self::ENCODED_LEN {
38457 payload_buf[0..avail_len].copy_from_slice(__input);
38458 Bytes::new(&payload_buf)
38459 } else {
38460 Bytes::new(__input)
38461 };
38462 let mut __struct = Self::default();
38463 __struct.mask = buf.get_u64_le();
38464 __struct.lat = buf.get_i32_le();
38465 __struct.lon = buf.get_i32_le();
38466 __struct.grid_spacing = buf.get_u16_le();
38467 Ok(__struct)
38468 }
38469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38470 let mut __tmp = BytesMut::new(bytes);
38471 #[allow(clippy::absurd_extreme_comparisons)]
38472 #[allow(unused_comparisons)]
38473 if __tmp.remaining() < Self::ENCODED_LEN {
38474 panic!(
38475 "buffer is too small (need {} bytes, but got {})",
38476 Self::ENCODED_LEN,
38477 __tmp.remaining(),
38478 )
38479 }
38480 __tmp.put_u64_le(self.mask);
38481 __tmp.put_i32_le(self.lat);
38482 __tmp.put_i32_le(self.lon);
38483 __tmp.put_u16_le(self.grid_spacing);
38484 if matches!(version, MavlinkVersion::V2) {
38485 let len = __tmp.len();
38486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38487 } else {
38488 __tmp.len()
38489 }
38490 }
38491}
38492#[doc = "id: 111"]
38493#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
38494#[derive(Debug, Clone, PartialEq)]
38495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38497pub struct TIMESYNC_DATA {
38498 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
38499 pub tc1: i64,
38500 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
38501 pub ts1: i64,
38502 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
38503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
38504 pub target_system: u8,
38505 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
38506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
38507 pub target_component: u8,
38508}
38509impl TIMESYNC_DATA {
38510 pub const ENCODED_LEN: usize = 18usize;
38511 pub const DEFAULT: Self = Self {
38512 tc1: 0_i64,
38513 ts1: 0_i64,
38514 target_system: 0_u8,
38515 target_component: 0_u8,
38516 };
38517 #[cfg(feature = "arbitrary")]
38518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38519 use arbitrary::{Arbitrary, Unstructured};
38520 let mut buf = [0u8; 1024];
38521 rng.fill_bytes(&mut buf);
38522 let mut unstructured = Unstructured::new(&buf);
38523 Self::arbitrary(&mut unstructured).unwrap_or_default()
38524 }
38525}
38526impl Default for TIMESYNC_DATA {
38527 fn default() -> Self {
38528 Self::DEFAULT.clone()
38529 }
38530}
38531impl MessageData for TIMESYNC_DATA {
38532 type Message = MavMessage;
38533 const ID: u32 = 111u32;
38534 const NAME: &'static str = "TIMESYNC";
38535 const EXTRA_CRC: u8 = 34u8;
38536 const ENCODED_LEN: usize = 18usize;
38537 fn deser(
38538 _version: MavlinkVersion,
38539 __input: &[u8],
38540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38541 let avail_len = __input.len();
38542 let mut payload_buf = [0; Self::ENCODED_LEN];
38543 let mut buf = if avail_len < Self::ENCODED_LEN {
38544 payload_buf[0..avail_len].copy_from_slice(__input);
38545 Bytes::new(&payload_buf)
38546 } else {
38547 Bytes::new(__input)
38548 };
38549 let mut __struct = Self::default();
38550 __struct.tc1 = buf.get_i64_le();
38551 __struct.ts1 = buf.get_i64_le();
38552 __struct.target_system = buf.get_u8();
38553 __struct.target_component = buf.get_u8();
38554 Ok(__struct)
38555 }
38556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38557 let mut __tmp = BytesMut::new(bytes);
38558 #[allow(clippy::absurd_extreme_comparisons)]
38559 #[allow(unused_comparisons)]
38560 if __tmp.remaining() < Self::ENCODED_LEN {
38561 panic!(
38562 "buffer is too small (need {} bytes, but got {})",
38563 Self::ENCODED_LEN,
38564 __tmp.remaining(),
38565 )
38566 }
38567 __tmp.put_i64_le(self.tc1);
38568 __tmp.put_i64_le(self.ts1);
38569 __tmp.put_u8(self.target_system);
38570 __tmp.put_u8(self.target_component);
38571 if matches!(version, MavlinkVersion::V2) {
38572 let len = __tmp.len();
38573 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38574 } else {
38575 __tmp.len()
38576 }
38577 }
38578}
38579#[doc = "id: 380"]
38580#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
38581#[derive(Debug, Clone, PartialEq)]
38582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38583#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38584pub struct TIME_ESTIMATE_TO_TARGET_DATA {
38585 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
38586 pub safe_return: i32,
38587 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
38588 pub land: i32,
38589 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
38590 pub mission_next_item: i32,
38591 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
38592 pub mission_end: i32,
38593 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
38594 pub commanded_action: i32,
38595}
38596impl TIME_ESTIMATE_TO_TARGET_DATA {
38597 pub const ENCODED_LEN: usize = 20usize;
38598 pub const DEFAULT: Self = Self {
38599 safe_return: 0_i32,
38600 land: 0_i32,
38601 mission_next_item: 0_i32,
38602 mission_end: 0_i32,
38603 commanded_action: 0_i32,
38604 };
38605 #[cfg(feature = "arbitrary")]
38606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38607 use arbitrary::{Arbitrary, Unstructured};
38608 let mut buf = [0u8; 1024];
38609 rng.fill_bytes(&mut buf);
38610 let mut unstructured = Unstructured::new(&buf);
38611 Self::arbitrary(&mut unstructured).unwrap_or_default()
38612 }
38613}
38614impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
38615 fn default() -> Self {
38616 Self::DEFAULT.clone()
38617 }
38618}
38619impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
38620 type Message = MavMessage;
38621 const ID: u32 = 380u32;
38622 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
38623 const EXTRA_CRC: u8 = 232u8;
38624 const ENCODED_LEN: usize = 20usize;
38625 fn deser(
38626 _version: MavlinkVersion,
38627 __input: &[u8],
38628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38629 let avail_len = __input.len();
38630 let mut payload_buf = [0; Self::ENCODED_LEN];
38631 let mut buf = if avail_len < Self::ENCODED_LEN {
38632 payload_buf[0..avail_len].copy_from_slice(__input);
38633 Bytes::new(&payload_buf)
38634 } else {
38635 Bytes::new(__input)
38636 };
38637 let mut __struct = Self::default();
38638 __struct.safe_return = buf.get_i32_le();
38639 __struct.land = buf.get_i32_le();
38640 __struct.mission_next_item = buf.get_i32_le();
38641 __struct.mission_end = buf.get_i32_le();
38642 __struct.commanded_action = buf.get_i32_le();
38643 Ok(__struct)
38644 }
38645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38646 let mut __tmp = BytesMut::new(bytes);
38647 #[allow(clippy::absurd_extreme_comparisons)]
38648 #[allow(unused_comparisons)]
38649 if __tmp.remaining() < Self::ENCODED_LEN {
38650 panic!(
38651 "buffer is too small (need {} bytes, but got {})",
38652 Self::ENCODED_LEN,
38653 __tmp.remaining(),
38654 )
38655 }
38656 __tmp.put_i32_le(self.safe_return);
38657 __tmp.put_i32_le(self.land);
38658 __tmp.put_i32_le(self.mission_next_item);
38659 __tmp.put_i32_le(self.mission_end);
38660 __tmp.put_i32_le(self.commanded_action);
38661 if matches!(version, MavlinkVersion::V2) {
38662 let len = __tmp.len();
38663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38664 } else {
38665 __tmp.len()
38666 }
38667 }
38668}
38669#[doc = "id: 333"]
38670#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
38671#[derive(Debug, Clone, PartialEq)]
38672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38674pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
38675 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
38676 pub time_usec: u64,
38677 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
38678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38679 pub pos_x: [f32; 5],
38680 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
38681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38682 pub pos_y: [f32; 5],
38683 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
38684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38685 pub pos_z: [f32; 5],
38686 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
38687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38688 pub delta: [f32; 5],
38689 #[doc = "Yaw. Set to NaN for unchanged"]
38690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38691 pub pos_yaw: [f32; 5],
38692 #[doc = "Number of valid control points (up-to 5 points are possible)"]
38693 pub valid_points: u8,
38694}
38695impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
38696 pub const ENCODED_LEN: usize = 109usize;
38697 pub const DEFAULT: Self = Self {
38698 time_usec: 0_u64,
38699 pos_x: [0.0_f32; 5usize],
38700 pos_y: [0.0_f32; 5usize],
38701 pos_z: [0.0_f32; 5usize],
38702 delta: [0.0_f32; 5usize],
38703 pos_yaw: [0.0_f32; 5usize],
38704 valid_points: 0_u8,
38705 };
38706 #[cfg(feature = "arbitrary")]
38707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38708 use arbitrary::{Arbitrary, Unstructured};
38709 let mut buf = [0u8; 1024];
38710 rng.fill_bytes(&mut buf);
38711 let mut unstructured = Unstructured::new(&buf);
38712 Self::arbitrary(&mut unstructured).unwrap_or_default()
38713 }
38714}
38715impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
38716 fn default() -> Self {
38717 Self::DEFAULT.clone()
38718 }
38719}
38720impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
38721 type Message = MavMessage;
38722 const ID: u32 = 333u32;
38723 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
38724 const EXTRA_CRC: u8 = 231u8;
38725 const ENCODED_LEN: usize = 109usize;
38726 fn deser(
38727 _version: MavlinkVersion,
38728 __input: &[u8],
38729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38730 let avail_len = __input.len();
38731 let mut payload_buf = [0; Self::ENCODED_LEN];
38732 let mut buf = if avail_len < Self::ENCODED_LEN {
38733 payload_buf[0..avail_len].copy_from_slice(__input);
38734 Bytes::new(&payload_buf)
38735 } else {
38736 Bytes::new(__input)
38737 };
38738 let mut __struct = Self::default();
38739 __struct.time_usec = buf.get_u64_le();
38740 for v in &mut __struct.pos_x {
38741 let val = buf.get_f32_le();
38742 *v = val;
38743 }
38744 for v in &mut __struct.pos_y {
38745 let val = buf.get_f32_le();
38746 *v = val;
38747 }
38748 for v in &mut __struct.pos_z {
38749 let val = buf.get_f32_le();
38750 *v = val;
38751 }
38752 for v in &mut __struct.delta {
38753 let val = buf.get_f32_le();
38754 *v = val;
38755 }
38756 for v in &mut __struct.pos_yaw {
38757 let val = buf.get_f32_le();
38758 *v = val;
38759 }
38760 __struct.valid_points = buf.get_u8();
38761 Ok(__struct)
38762 }
38763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38764 let mut __tmp = BytesMut::new(bytes);
38765 #[allow(clippy::absurd_extreme_comparisons)]
38766 #[allow(unused_comparisons)]
38767 if __tmp.remaining() < Self::ENCODED_LEN {
38768 panic!(
38769 "buffer is too small (need {} bytes, but got {})",
38770 Self::ENCODED_LEN,
38771 __tmp.remaining(),
38772 )
38773 }
38774 __tmp.put_u64_le(self.time_usec);
38775 for val in &self.pos_x {
38776 __tmp.put_f32_le(*val);
38777 }
38778 for val in &self.pos_y {
38779 __tmp.put_f32_le(*val);
38780 }
38781 for val in &self.pos_z {
38782 __tmp.put_f32_le(*val);
38783 }
38784 for val in &self.delta {
38785 __tmp.put_f32_le(*val);
38786 }
38787 for val in &self.pos_yaw {
38788 __tmp.put_f32_le(*val);
38789 }
38790 __tmp.put_u8(self.valid_points);
38791 if matches!(version, MavlinkVersion::V2) {
38792 let len = __tmp.len();
38793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
38794 } else {
38795 __tmp.len()
38796 }
38797 }
38798}
38799#[doc = "id: 332"]
38800#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
38801#[derive(Debug, Clone, PartialEq)]
38802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
38803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
38804pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
38805 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
38806 pub time_usec: u64,
38807 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
38808 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38809 pub pos_x: [f32; 5],
38810 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
38811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38812 pub pos_y: [f32; 5],
38813 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
38814 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38815 pub pos_z: [f32; 5],
38816 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
38817 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38818 pub vel_x: [f32; 5],
38819 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
38820 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38821 pub vel_y: [f32; 5],
38822 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
38823 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38824 pub vel_z: [f32; 5],
38825 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
38826 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38827 pub acc_x: [f32; 5],
38828 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
38829 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38830 pub acc_y: [f32; 5],
38831 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
38832 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38833 pub acc_z: [f32; 5],
38834 #[doc = "Yaw angle, set to NaN if not being used"]
38835 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38836 pub pos_yaw: [f32; 5],
38837 #[doc = "Yaw rate, set to NaN if not being used"]
38838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38839 pub vel_yaw: [f32; 5],
38840 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
38841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
38842 pub command: [u16; 5],
38843 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
38844 pub valid_points: u8,
38845}
38846impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
38847 pub const ENCODED_LEN: usize = 239usize;
38848 pub const DEFAULT: Self = Self {
38849 time_usec: 0_u64,
38850 pos_x: [0.0_f32; 5usize],
38851 pos_y: [0.0_f32; 5usize],
38852 pos_z: [0.0_f32; 5usize],
38853 vel_x: [0.0_f32; 5usize],
38854 vel_y: [0.0_f32; 5usize],
38855 vel_z: [0.0_f32; 5usize],
38856 acc_x: [0.0_f32; 5usize],
38857 acc_y: [0.0_f32; 5usize],
38858 acc_z: [0.0_f32; 5usize],
38859 pos_yaw: [0.0_f32; 5usize],
38860 vel_yaw: [0.0_f32; 5usize],
38861 command: [0_u16; 5usize],
38862 valid_points: 0_u8,
38863 };
38864 #[cfg(feature = "arbitrary")]
38865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
38866 use arbitrary::{Arbitrary, Unstructured};
38867 let mut buf = [0u8; 1024];
38868 rng.fill_bytes(&mut buf);
38869 let mut unstructured = Unstructured::new(&buf);
38870 Self::arbitrary(&mut unstructured).unwrap_or_default()
38871 }
38872}
38873impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
38874 fn default() -> Self {
38875 Self::DEFAULT.clone()
38876 }
38877}
38878impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
38879 type Message = MavMessage;
38880 const ID: u32 = 332u32;
38881 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
38882 const EXTRA_CRC: u8 = 236u8;
38883 const ENCODED_LEN: usize = 239usize;
38884 fn deser(
38885 _version: MavlinkVersion,
38886 __input: &[u8],
38887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
38888 let avail_len = __input.len();
38889 let mut payload_buf = [0; Self::ENCODED_LEN];
38890 let mut buf = if avail_len < Self::ENCODED_LEN {
38891 payload_buf[0..avail_len].copy_from_slice(__input);
38892 Bytes::new(&payload_buf)
38893 } else {
38894 Bytes::new(__input)
38895 };
38896 let mut __struct = Self::default();
38897 __struct.time_usec = buf.get_u64_le();
38898 for v in &mut __struct.pos_x {
38899 let val = buf.get_f32_le();
38900 *v = val;
38901 }
38902 for v in &mut __struct.pos_y {
38903 let val = buf.get_f32_le();
38904 *v = val;
38905 }
38906 for v in &mut __struct.pos_z {
38907 let val = buf.get_f32_le();
38908 *v = val;
38909 }
38910 for v in &mut __struct.vel_x {
38911 let val = buf.get_f32_le();
38912 *v = val;
38913 }
38914 for v in &mut __struct.vel_y {
38915 let val = buf.get_f32_le();
38916 *v = val;
38917 }
38918 for v in &mut __struct.vel_z {
38919 let val = buf.get_f32_le();
38920 *v = val;
38921 }
38922 for v in &mut __struct.acc_x {
38923 let val = buf.get_f32_le();
38924 *v = val;
38925 }
38926 for v in &mut __struct.acc_y {
38927 let val = buf.get_f32_le();
38928 *v = val;
38929 }
38930 for v in &mut __struct.acc_z {
38931 let val = buf.get_f32_le();
38932 *v = val;
38933 }
38934 for v in &mut __struct.pos_yaw {
38935 let val = buf.get_f32_le();
38936 *v = val;
38937 }
38938 for v in &mut __struct.vel_yaw {
38939 let val = buf.get_f32_le();
38940 *v = val;
38941 }
38942 for v in &mut __struct.command {
38943 let val = buf.get_u16_le();
38944 *v = val;
38945 }
38946 __struct.valid_points = buf.get_u8();
38947 Ok(__struct)
38948 }
38949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
38950 let mut __tmp = BytesMut::new(bytes);
38951 #[allow(clippy::absurd_extreme_comparisons)]
38952 #[allow(unused_comparisons)]
38953 if __tmp.remaining() < Self::ENCODED_LEN {
38954 panic!(
38955 "buffer is too small (need {} bytes, but got {})",
38956 Self::ENCODED_LEN,
38957 __tmp.remaining(),
38958 )
38959 }
38960 __tmp.put_u64_le(self.time_usec);
38961 for val in &self.pos_x {
38962 __tmp.put_f32_le(*val);
38963 }
38964 for val in &self.pos_y {
38965 __tmp.put_f32_le(*val);
38966 }
38967 for val in &self.pos_z {
38968 __tmp.put_f32_le(*val);
38969 }
38970 for val in &self.vel_x {
38971 __tmp.put_f32_le(*val);
38972 }
38973 for val in &self.vel_y {
38974 __tmp.put_f32_le(*val);
38975 }
38976 for val in &self.vel_z {
38977 __tmp.put_f32_le(*val);
38978 }
38979 for val in &self.acc_x {
38980 __tmp.put_f32_le(*val);
38981 }
38982 for val in &self.acc_y {
38983 __tmp.put_f32_le(*val);
38984 }
38985 for val in &self.acc_z {
38986 __tmp.put_f32_le(*val);
38987 }
38988 for val in &self.pos_yaw {
38989 __tmp.put_f32_le(*val);
38990 }
38991 for val in &self.vel_yaw {
38992 __tmp.put_f32_le(*val);
38993 }
38994 for val in &self.command {
38995 __tmp.put_u16_le(*val);
38996 }
38997 __tmp.put_u8(self.valid_points);
38998 if matches!(version, MavlinkVersion::V2) {
38999 let len = __tmp.len();
39000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39001 } else {
39002 __tmp.len()
39003 }
39004 }
39005}
39006#[doc = "id: 385"]
39007#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
39008#[derive(Debug, Clone, PartialEq)]
39009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39011pub struct TUNNEL_DATA {
39012 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
39013 pub payload_type: MavTunnelPayloadType,
39014 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
39015 pub target_system: u8,
39016 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
39017 pub target_component: u8,
39018 #[doc = "Length of the data transported in payload"]
39019 pub payload_length: u8,
39020 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
39021 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39022 pub payload: [u8; 128],
39023}
39024impl TUNNEL_DATA {
39025 pub const ENCODED_LEN: usize = 133usize;
39026 pub const DEFAULT: Self = Self {
39027 payload_type: MavTunnelPayloadType::DEFAULT,
39028 target_system: 0_u8,
39029 target_component: 0_u8,
39030 payload_length: 0_u8,
39031 payload: [0_u8; 128usize],
39032 };
39033 #[cfg(feature = "arbitrary")]
39034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39035 use arbitrary::{Arbitrary, Unstructured};
39036 let mut buf = [0u8; 1024];
39037 rng.fill_bytes(&mut buf);
39038 let mut unstructured = Unstructured::new(&buf);
39039 Self::arbitrary(&mut unstructured).unwrap_or_default()
39040 }
39041}
39042impl Default for TUNNEL_DATA {
39043 fn default() -> Self {
39044 Self::DEFAULT.clone()
39045 }
39046}
39047impl MessageData for TUNNEL_DATA {
39048 type Message = MavMessage;
39049 const ID: u32 = 385u32;
39050 const NAME: &'static str = "TUNNEL";
39051 const EXTRA_CRC: u8 = 147u8;
39052 const ENCODED_LEN: usize = 133usize;
39053 fn deser(
39054 _version: MavlinkVersion,
39055 __input: &[u8],
39056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39057 let avail_len = __input.len();
39058 let mut payload_buf = [0; Self::ENCODED_LEN];
39059 let mut buf = if avail_len < Self::ENCODED_LEN {
39060 payload_buf[0..avail_len].copy_from_slice(__input);
39061 Bytes::new(&payload_buf)
39062 } else {
39063 Bytes::new(__input)
39064 };
39065 let mut __struct = Self::default();
39066 let tmp = buf.get_u16_le();
39067 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
39068 ::mavlink_core::error::ParserError::InvalidEnum {
39069 enum_type: "MavTunnelPayloadType",
39070 value: tmp as u32,
39071 },
39072 )?;
39073 __struct.target_system = buf.get_u8();
39074 __struct.target_component = buf.get_u8();
39075 __struct.payload_length = buf.get_u8();
39076 for v in &mut __struct.payload {
39077 let val = buf.get_u8();
39078 *v = val;
39079 }
39080 Ok(__struct)
39081 }
39082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39083 let mut __tmp = BytesMut::new(bytes);
39084 #[allow(clippy::absurd_extreme_comparisons)]
39085 #[allow(unused_comparisons)]
39086 if __tmp.remaining() < Self::ENCODED_LEN {
39087 panic!(
39088 "buffer is too small (need {} bytes, but got {})",
39089 Self::ENCODED_LEN,
39090 __tmp.remaining(),
39091 )
39092 }
39093 __tmp.put_u16_le(self.payload_type as u16);
39094 __tmp.put_u8(self.target_system);
39095 __tmp.put_u8(self.target_component);
39096 __tmp.put_u8(self.payload_length);
39097 for val in &self.payload {
39098 __tmp.put_u8(*val);
39099 }
39100 if matches!(version, MavlinkVersion::V2) {
39101 let len = __tmp.len();
39102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39103 } else {
39104 __tmp.len()
39105 }
39106 }
39107}
39108#[doc = "id: 311"]
39109#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
39110#[derive(Debug, Clone, PartialEq)]
39111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39113pub struct UAVCAN_NODE_INFO_DATA {
39114 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
39115 pub time_usec: u64,
39116 #[doc = "Time since the start-up of the node."]
39117 pub uptime_sec: u32,
39118 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
39119 pub sw_vcs_commit: u32,
39120 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
39121 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39122 pub name: [u8; 80],
39123 #[doc = "Hardware major version number."]
39124 pub hw_version_major: u8,
39125 #[doc = "Hardware minor version number."]
39126 pub hw_version_minor: u8,
39127 #[doc = "Hardware unique 128-bit ID."]
39128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39129 pub hw_unique_id: [u8; 16],
39130 #[doc = "Software major version number."]
39131 pub sw_version_major: u8,
39132 #[doc = "Software minor version number."]
39133 pub sw_version_minor: u8,
39134}
39135impl UAVCAN_NODE_INFO_DATA {
39136 pub const ENCODED_LEN: usize = 116usize;
39137 pub const DEFAULT: Self = Self {
39138 time_usec: 0_u64,
39139 uptime_sec: 0_u32,
39140 sw_vcs_commit: 0_u32,
39141 name: [0_u8; 80usize],
39142 hw_version_major: 0_u8,
39143 hw_version_minor: 0_u8,
39144 hw_unique_id: [0_u8; 16usize],
39145 sw_version_major: 0_u8,
39146 sw_version_minor: 0_u8,
39147 };
39148 #[cfg(feature = "arbitrary")]
39149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39150 use arbitrary::{Arbitrary, Unstructured};
39151 let mut buf = [0u8; 1024];
39152 rng.fill_bytes(&mut buf);
39153 let mut unstructured = Unstructured::new(&buf);
39154 Self::arbitrary(&mut unstructured).unwrap_or_default()
39155 }
39156}
39157impl Default for UAVCAN_NODE_INFO_DATA {
39158 fn default() -> Self {
39159 Self::DEFAULT.clone()
39160 }
39161}
39162impl MessageData for UAVCAN_NODE_INFO_DATA {
39163 type Message = MavMessage;
39164 const ID: u32 = 311u32;
39165 const NAME: &'static str = "UAVCAN_NODE_INFO";
39166 const EXTRA_CRC: u8 = 95u8;
39167 const ENCODED_LEN: usize = 116usize;
39168 fn deser(
39169 _version: MavlinkVersion,
39170 __input: &[u8],
39171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39172 let avail_len = __input.len();
39173 let mut payload_buf = [0; Self::ENCODED_LEN];
39174 let mut buf = if avail_len < Self::ENCODED_LEN {
39175 payload_buf[0..avail_len].copy_from_slice(__input);
39176 Bytes::new(&payload_buf)
39177 } else {
39178 Bytes::new(__input)
39179 };
39180 let mut __struct = Self::default();
39181 __struct.time_usec = buf.get_u64_le();
39182 __struct.uptime_sec = buf.get_u32_le();
39183 __struct.sw_vcs_commit = buf.get_u32_le();
39184 for v in &mut __struct.name {
39185 let val = buf.get_u8();
39186 *v = val;
39187 }
39188 __struct.hw_version_major = buf.get_u8();
39189 __struct.hw_version_minor = buf.get_u8();
39190 for v in &mut __struct.hw_unique_id {
39191 let val = buf.get_u8();
39192 *v = val;
39193 }
39194 __struct.sw_version_major = buf.get_u8();
39195 __struct.sw_version_minor = buf.get_u8();
39196 Ok(__struct)
39197 }
39198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39199 let mut __tmp = BytesMut::new(bytes);
39200 #[allow(clippy::absurd_extreme_comparisons)]
39201 #[allow(unused_comparisons)]
39202 if __tmp.remaining() < Self::ENCODED_LEN {
39203 panic!(
39204 "buffer is too small (need {} bytes, but got {})",
39205 Self::ENCODED_LEN,
39206 __tmp.remaining(),
39207 )
39208 }
39209 __tmp.put_u64_le(self.time_usec);
39210 __tmp.put_u32_le(self.uptime_sec);
39211 __tmp.put_u32_le(self.sw_vcs_commit);
39212 for val in &self.name {
39213 __tmp.put_u8(*val);
39214 }
39215 __tmp.put_u8(self.hw_version_major);
39216 __tmp.put_u8(self.hw_version_minor);
39217 for val in &self.hw_unique_id {
39218 __tmp.put_u8(*val);
39219 }
39220 __tmp.put_u8(self.sw_version_major);
39221 __tmp.put_u8(self.sw_version_minor);
39222 if matches!(version, MavlinkVersion::V2) {
39223 let len = __tmp.len();
39224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39225 } else {
39226 __tmp.len()
39227 }
39228 }
39229}
39230#[doc = "id: 310"]
39231#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
39232#[derive(Debug, Clone, PartialEq)]
39233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39235pub struct UAVCAN_NODE_STATUS_DATA {
39236 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
39237 pub time_usec: u64,
39238 #[doc = "Time since the start-up of the node."]
39239 pub uptime_sec: u32,
39240 #[doc = "Vendor-specific status information."]
39241 pub vendor_specific_status_code: u16,
39242 #[doc = "Generalized node health status."]
39243 pub health: UavcanNodeHealth,
39244 #[doc = "Generalized operating mode."]
39245 pub mode: UavcanNodeMode,
39246 #[doc = "Not used currently."]
39247 pub sub_mode: u8,
39248}
39249impl UAVCAN_NODE_STATUS_DATA {
39250 pub const ENCODED_LEN: usize = 17usize;
39251 pub const DEFAULT: Self = Self {
39252 time_usec: 0_u64,
39253 uptime_sec: 0_u32,
39254 vendor_specific_status_code: 0_u16,
39255 health: UavcanNodeHealth::DEFAULT,
39256 mode: UavcanNodeMode::DEFAULT,
39257 sub_mode: 0_u8,
39258 };
39259 #[cfg(feature = "arbitrary")]
39260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39261 use arbitrary::{Arbitrary, Unstructured};
39262 let mut buf = [0u8; 1024];
39263 rng.fill_bytes(&mut buf);
39264 let mut unstructured = Unstructured::new(&buf);
39265 Self::arbitrary(&mut unstructured).unwrap_or_default()
39266 }
39267}
39268impl Default for UAVCAN_NODE_STATUS_DATA {
39269 fn default() -> Self {
39270 Self::DEFAULT.clone()
39271 }
39272}
39273impl MessageData for UAVCAN_NODE_STATUS_DATA {
39274 type Message = MavMessage;
39275 const ID: u32 = 310u32;
39276 const NAME: &'static str = "UAVCAN_NODE_STATUS";
39277 const EXTRA_CRC: u8 = 28u8;
39278 const ENCODED_LEN: usize = 17usize;
39279 fn deser(
39280 _version: MavlinkVersion,
39281 __input: &[u8],
39282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39283 let avail_len = __input.len();
39284 let mut payload_buf = [0; Self::ENCODED_LEN];
39285 let mut buf = if avail_len < Self::ENCODED_LEN {
39286 payload_buf[0..avail_len].copy_from_slice(__input);
39287 Bytes::new(&payload_buf)
39288 } else {
39289 Bytes::new(__input)
39290 };
39291 let mut __struct = Self::default();
39292 __struct.time_usec = buf.get_u64_le();
39293 __struct.uptime_sec = buf.get_u32_le();
39294 __struct.vendor_specific_status_code = buf.get_u16_le();
39295 let tmp = buf.get_u8();
39296 __struct.health =
39297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39298 enum_type: "UavcanNodeHealth",
39299 value: tmp as u32,
39300 })?;
39301 let tmp = buf.get_u8();
39302 __struct.mode =
39303 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39304 enum_type: "UavcanNodeMode",
39305 value: tmp as u32,
39306 })?;
39307 __struct.sub_mode = buf.get_u8();
39308 Ok(__struct)
39309 }
39310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39311 let mut __tmp = BytesMut::new(bytes);
39312 #[allow(clippy::absurd_extreme_comparisons)]
39313 #[allow(unused_comparisons)]
39314 if __tmp.remaining() < Self::ENCODED_LEN {
39315 panic!(
39316 "buffer is too small (need {} bytes, but got {})",
39317 Self::ENCODED_LEN,
39318 __tmp.remaining(),
39319 )
39320 }
39321 __tmp.put_u64_le(self.time_usec);
39322 __tmp.put_u32_le(self.uptime_sec);
39323 __tmp.put_u16_le(self.vendor_specific_status_code);
39324 __tmp.put_u8(self.health as u8);
39325 __tmp.put_u8(self.mode as u8);
39326 __tmp.put_u8(self.sub_mode);
39327 if matches!(version, MavlinkVersion::V2) {
39328 let len = __tmp.len();
39329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39330 } else {
39331 __tmp.len()
39332 }
39333 }
39334}
39335#[doc = "id: 10006"]
39336#[doc = "Request messages."]
39337#[derive(Debug, Clone, PartialEq)]
39338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39340pub struct UAVIONIX_ADSB_GET_DATA {
39341 #[doc = "Message ID to request. Supports any message in this 10000-10099 range"]
39342 pub ReqMessageId: u32,
39343}
39344impl UAVIONIX_ADSB_GET_DATA {
39345 pub const ENCODED_LEN: usize = 4usize;
39346 pub const DEFAULT: Self = Self {
39347 ReqMessageId: 0_u32,
39348 };
39349 #[cfg(feature = "arbitrary")]
39350 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39351 use arbitrary::{Arbitrary, Unstructured};
39352 let mut buf = [0u8; 1024];
39353 rng.fill_bytes(&mut buf);
39354 let mut unstructured = Unstructured::new(&buf);
39355 Self::arbitrary(&mut unstructured).unwrap_or_default()
39356 }
39357}
39358impl Default for UAVIONIX_ADSB_GET_DATA {
39359 fn default() -> Self {
39360 Self::DEFAULT.clone()
39361 }
39362}
39363impl MessageData for UAVIONIX_ADSB_GET_DATA {
39364 type Message = MavMessage;
39365 const ID: u32 = 10006u32;
39366 const NAME: &'static str = "UAVIONIX_ADSB_GET";
39367 const EXTRA_CRC: u8 = 193u8;
39368 const ENCODED_LEN: usize = 4usize;
39369 fn deser(
39370 _version: MavlinkVersion,
39371 __input: &[u8],
39372 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39373 let avail_len = __input.len();
39374 let mut payload_buf = [0; Self::ENCODED_LEN];
39375 let mut buf = if avail_len < Self::ENCODED_LEN {
39376 payload_buf[0..avail_len].copy_from_slice(__input);
39377 Bytes::new(&payload_buf)
39378 } else {
39379 Bytes::new(__input)
39380 };
39381 let mut __struct = Self::default();
39382 __struct.ReqMessageId = buf.get_u32_le();
39383 Ok(__struct)
39384 }
39385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39386 let mut __tmp = BytesMut::new(bytes);
39387 #[allow(clippy::absurd_extreme_comparisons)]
39388 #[allow(unused_comparisons)]
39389 if __tmp.remaining() < Self::ENCODED_LEN {
39390 panic!(
39391 "buffer is too small (need {} bytes, but got {})",
39392 Self::ENCODED_LEN,
39393 __tmp.remaining(),
39394 )
39395 }
39396 __tmp.put_u32_le(self.ReqMessageId);
39397 if matches!(version, MavlinkVersion::V2) {
39398 let len = __tmp.len();
39399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39400 } else {
39401 __tmp.len()
39402 }
39403 }
39404}
39405#[doc = "id: 10001"]
39406#[doc = "Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter)."]
39407#[derive(Debug, Clone, PartialEq)]
39408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39410pub struct UAVIONIX_ADSB_OUT_CFG_DATA {
39411 #[doc = "Vehicle address (24 bit)"]
39412 pub ICAO: u32,
39413 #[doc = "Aircraft stall speed in cm/s"]
39414 pub stallSpeed: u16,
39415 #[doc = "Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, \" \" only)"]
39416 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39417 pub callsign: [u8; 9],
39418 #[doc = "Transmitting vehicle type. See ADSB_EMITTER_TYPE enum"]
39419 pub emitterType: AdsbEmitterType,
39420 #[doc = "Aircraft length and width encoding (table 2-35 of DO-282B)"]
39421 pub aircraftSize: UavionixAdsbOutCfgAircraftSize,
39422 #[doc = "GPS antenna lateral offset (table 2-36 of DO-282B)"]
39423 pub gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat,
39424 #[doc = "GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)"]
39425 pub gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon,
39426 #[doc = "ADS-B transponder reciever and transmit enable flags"]
39427 pub rfSelect: UavionixAdsbOutRfSelect,
39428}
39429impl UAVIONIX_ADSB_OUT_CFG_DATA {
39430 pub const ENCODED_LEN: usize = 20usize;
39431 pub const DEFAULT: Self = Self {
39432 ICAO: 0_u32,
39433 stallSpeed: 0_u16,
39434 callsign: [0_u8; 9usize],
39435 emitterType: AdsbEmitterType::DEFAULT,
39436 aircraftSize: UavionixAdsbOutCfgAircraftSize::DEFAULT,
39437 gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat::DEFAULT,
39438 gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon::DEFAULT,
39439 rfSelect: UavionixAdsbOutRfSelect::DEFAULT,
39440 };
39441 #[cfg(feature = "arbitrary")]
39442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39443 use arbitrary::{Arbitrary, Unstructured};
39444 let mut buf = [0u8; 1024];
39445 rng.fill_bytes(&mut buf);
39446 let mut unstructured = Unstructured::new(&buf);
39447 Self::arbitrary(&mut unstructured).unwrap_or_default()
39448 }
39449}
39450impl Default for UAVIONIX_ADSB_OUT_CFG_DATA {
39451 fn default() -> Self {
39452 Self::DEFAULT.clone()
39453 }
39454}
39455impl MessageData for UAVIONIX_ADSB_OUT_CFG_DATA {
39456 type Message = MavMessage;
39457 const ID: u32 = 10001u32;
39458 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG";
39459 const EXTRA_CRC: u8 = 209u8;
39460 const ENCODED_LEN: usize = 20usize;
39461 fn deser(
39462 _version: MavlinkVersion,
39463 __input: &[u8],
39464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39465 let avail_len = __input.len();
39466 let mut payload_buf = [0; Self::ENCODED_LEN];
39467 let mut buf = if avail_len < Self::ENCODED_LEN {
39468 payload_buf[0..avail_len].copy_from_slice(__input);
39469 Bytes::new(&payload_buf)
39470 } else {
39471 Bytes::new(__input)
39472 };
39473 let mut __struct = Self::default();
39474 __struct.ICAO = buf.get_u32_le();
39475 __struct.stallSpeed = buf.get_u16_le();
39476 for v in &mut __struct.callsign {
39477 let val = buf.get_u8();
39478 *v = val;
39479 }
39480 let tmp = buf.get_u8();
39481 __struct.emitterType =
39482 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39483 enum_type: "AdsbEmitterType",
39484 value: tmp as u32,
39485 })?;
39486 let tmp = buf.get_u8();
39487 __struct.aircraftSize =
39488 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39489 enum_type: "UavionixAdsbOutCfgAircraftSize",
39490 value: tmp as u32,
39491 })?;
39492 let tmp = buf.get_u8();
39493 __struct.gpsOffsetLat =
39494 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39495 enum_type: "UavionixAdsbOutCfgGpsOffsetLat",
39496 value: tmp as u32,
39497 })?;
39498 let tmp = buf.get_u8();
39499 __struct.gpsOffsetLon =
39500 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39501 enum_type: "UavionixAdsbOutCfgGpsOffsetLon",
39502 value: tmp as u32,
39503 })?;
39504 let tmp = buf.get_u8();
39505 __struct.rfSelect = UavionixAdsbOutRfSelect::from_bits(
39506 tmp & UavionixAdsbOutRfSelect::all().bits(),
39507 )
39508 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
39509 flag_type: "UavionixAdsbOutRfSelect",
39510 value: tmp as u32,
39511 })?;
39512 Ok(__struct)
39513 }
39514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39515 let mut __tmp = BytesMut::new(bytes);
39516 #[allow(clippy::absurd_extreme_comparisons)]
39517 #[allow(unused_comparisons)]
39518 if __tmp.remaining() < Self::ENCODED_LEN {
39519 panic!(
39520 "buffer is too small (need {} bytes, but got {})",
39521 Self::ENCODED_LEN,
39522 __tmp.remaining(),
39523 )
39524 }
39525 __tmp.put_u32_le(self.ICAO);
39526 __tmp.put_u16_le(self.stallSpeed);
39527 for val in &self.callsign {
39528 __tmp.put_u8(*val);
39529 }
39530 __tmp.put_u8(self.emitterType as u8);
39531 __tmp.put_u8(self.aircraftSize as u8);
39532 __tmp.put_u8(self.gpsOffsetLat as u8);
39533 __tmp.put_u8(self.gpsOffsetLon as u8);
39534 __tmp.put_u8(self.rfSelect.bits());
39535 if matches!(version, MavlinkVersion::V2) {
39536 let len = __tmp.len();
39537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39538 } else {
39539 __tmp.len()
39540 }
39541 }
39542}
39543#[doc = "id: 10005"]
39544#[doc = "Flight Identification for ADSB-Out vehicles."]
39545#[derive(Debug, Clone, PartialEq)]
39546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39547#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39548pub struct UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
39549 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. Reflects Control message setting. This is null-terminated."]
39550 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39551 pub flight_id: [u8; 9],
39552}
39553impl UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
39554 pub const ENCODED_LEN: usize = 9usize;
39555 pub const DEFAULT: Self = Self {
39556 flight_id: [0_u8; 9usize],
39557 };
39558 #[cfg(feature = "arbitrary")]
39559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39560 use arbitrary::{Arbitrary, Unstructured};
39561 let mut buf = [0u8; 1024];
39562 rng.fill_bytes(&mut buf);
39563 let mut unstructured = Unstructured::new(&buf);
39564 Self::arbitrary(&mut unstructured).unwrap_or_default()
39565 }
39566}
39567impl Default for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
39568 fn default() -> Self {
39569 Self::DEFAULT.clone()
39570 }
39571}
39572impl MessageData for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
39573 type Message = MavMessage;
39574 const ID: u32 = 10005u32;
39575 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_FLIGHTID";
39576 const EXTRA_CRC: u8 = 103u8;
39577 const ENCODED_LEN: usize = 9usize;
39578 fn deser(
39579 _version: MavlinkVersion,
39580 __input: &[u8],
39581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39582 let avail_len = __input.len();
39583 let mut payload_buf = [0; Self::ENCODED_LEN];
39584 let mut buf = if avail_len < Self::ENCODED_LEN {
39585 payload_buf[0..avail_len].copy_from_slice(__input);
39586 Bytes::new(&payload_buf)
39587 } else {
39588 Bytes::new(__input)
39589 };
39590 let mut __struct = Self::default();
39591 for v in &mut __struct.flight_id {
39592 let val = buf.get_u8();
39593 *v = val;
39594 }
39595 Ok(__struct)
39596 }
39597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39598 let mut __tmp = BytesMut::new(bytes);
39599 #[allow(clippy::absurd_extreme_comparisons)]
39600 #[allow(unused_comparisons)]
39601 if __tmp.remaining() < Self::ENCODED_LEN {
39602 panic!(
39603 "buffer is too small (need {} bytes, but got {})",
39604 Self::ENCODED_LEN,
39605 __tmp.remaining(),
39606 )
39607 }
39608 for val in &self.flight_id {
39609 __tmp.put_u8(*val);
39610 }
39611 if matches!(version, MavlinkVersion::V2) {
39612 let len = __tmp.len();
39613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39614 } else {
39615 __tmp.len()
39616 }
39617 }
39618}
39619#[doc = "id: 10004"]
39620#[doc = "Aircraft Registration."]
39621#[derive(Debug, Clone, PartialEq)]
39622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39624pub struct UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
39625 #[doc = "Aircraft Registration (ASCII string A-Z, 0-9 only), e.g. \"N8644B \". Trailing spaces (0x20) only. This is null-terminated."]
39626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39627 pub registration: [u8; 9],
39628}
39629impl UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
39630 pub const ENCODED_LEN: usize = 9usize;
39631 pub const DEFAULT: Self = Self {
39632 registration: [0_u8; 9usize],
39633 };
39634 #[cfg(feature = "arbitrary")]
39635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39636 use arbitrary::{Arbitrary, Unstructured};
39637 let mut buf = [0u8; 1024];
39638 rng.fill_bytes(&mut buf);
39639 let mut unstructured = Unstructured::new(&buf);
39640 Self::arbitrary(&mut unstructured).unwrap_or_default()
39641 }
39642}
39643impl Default for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
39644 fn default() -> Self {
39645 Self::DEFAULT.clone()
39646 }
39647}
39648impl MessageData for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
39649 type Message = MavMessage;
39650 const ID: u32 = 10004u32;
39651 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_REGISTRATION";
39652 const EXTRA_CRC: u8 = 133u8;
39653 const ENCODED_LEN: usize = 9usize;
39654 fn deser(
39655 _version: MavlinkVersion,
39656 __input: &[u8],
39657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39658 let avail_len = __input.len();
39659 let mut payload_buf = [0; Self::ENCODED_LEN];
39660 let mut buf = if avail_len < Self::ENCODED_LEN {
39661 payload_buf[0..avail_len].copy_from_slice(__input);
39662 Bytes::new(&payload_buf)
39663 } else {
39664 Bytes::new(__input)
39665 };
39666 let mut __struct = Self::default();
39667 for v in &mut __struct.registration {
39668 let val = buf.get_u8();
39669 *v = val;
39670 }
39671 Ok(__struct)
39672 }
39673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39674 let mut __tmp = BytesMut::new(bytes);
39675 #[allow(clippy::absurd_extreme_comparisons)]
39676 #[allow(unused_comparisons)]
39677 if __tmp.remaining() < Self::ENCODED_LEN {
39678 panic!(
39679 "buffer is too small (need {} bytes, but got {})",
39680 Self::ENCODED_LEN,
39681 __tmp.remaining(),
39682 )
39683 }
39684 for val in &self.registration {
39685 __tmp.put_u8(*val);
39686 }
39687 if matches!(version, MavlinkVersion::V2) {
39688 let len = __tmp.len();
39689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39690 } else {
39691 __tmp.len()
39692 }
39693 }
39694}
39695#[doc = "id: 10007"]
39696#[doc = "Control message with all data sent in UCP control message."]
39697#[derive(Debug, Clone, PartialEq)]
39698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39700pub struct UAVIONIX_ADSB_OUT_CONTROL_DATA {
39701 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
39702 pub baroAltMSL: i32,
39703 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
39704 pub squawk: u16,
39705 #[doc = "ADS-B transponder control state flags"]
39706 pub state: UavionixAdsbOutControlState,
39707 #[doc = "Emergency status"]
39708 pub emergencyStatus: UavionixAdsbEmergencyStatus,
39709 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
39710 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39711 pub flight_id: [u8; 8],
39712 #[doc = "X-Bit enable (military transponders only)"]
39713 pub x_bit: UavionixAdsbXbit,
39714}
39715impl UAVIONIX_ADSB_OUT_CONTROL_DATA {
39716 pub const ENCODED_LEN: usize = 17usize;
39717 pub const DEFAULT: Self = Self {
39718 baroAltMSL: 0_i32,
39719 squawk: 0_u16,
39720 state: UavionixAdsbOutControlState::DEFAULT,
39721 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
39722 flight_id: [0_u8; 8usize],
39723 x_bit: UavionixAdsbXbit::DEFAULT,
39724 };
39725 #[cfg(feature = "arbitrary")]
39726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39727 use arbitrary::{Arbitrary, Unstructured};
39728 let mut buf = [0u8; 1024];
39729 rng.fill_bytes(&mut buf);
39730 let mut unstructured = Unstructured::new(&buf);
39731 Self::arbitrary(&mut unstructured).unwrap_or_default()
39732 }
39733}
39734impl Default for UAVIONIX_ADSB_OUT_CONTROL_DATA {
39735 fn default() -> Self {
39736 Self::DEFAULT.clone()
39737 }
39738}
39739impl MessageData for UAVIONIX_ADSB_OUT_CONTROL_DATA {
39740 type Message = MavMessage;
39741 const ID: u32 = 10007u32;
39742 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CONTROL";
39743 const EXTRA_CRC: u8 = 71u8;
39744 const ENCODED_LEN: usize = 17usize;
39745 fn deser(
39746 _version: MavlinkVersion,
39747 __input: &[u8],
39748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39749 let avail_len = __input.len();
39750 let mut payload_buf = [0; Self::ENCODED_LEN];
39751 let mut buf = if avail_len < Self::ENCODED_LEN {
39752 payload_buf[0..avail_len].copy_from_slice(__input);
39753 Bytes::new(&payload_buf)
39754 } else {
39755 Bytes::new(__input)
39756 };
39757 let mut __struct = Self::default();
39758 __struct.baroAltMSL = buf.get_i32_le();
39759 __struct.squawk = buf.get_u16_le();
39760 let tmp = buf.get_u8();
39761 __struct.state =
39762 UavionixAdsbOutControlState::from_bits(tmp & UavionixAdsbOutControlState::all().bits())
39763 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
39764 flag_type: "UavionixAdsbOutControlState",
39765 value: tmp as u32,
39766 })?;
39767 let tmp = buf.get_u8();
39768 __struct.emergencyStatus =
39769 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39770 enum_type: "UavionixAdsbEmergencyStatus",
39771 value: tmp as u32,
39772 })?;
39773 for v in &mut __struct.flight_id {
39774 let val = buf.get_u8();
39775 *v = val;
39776 }
39777 let tmp = buf.get_u8();
39778 __struct.x_bit = UavionixAdsbXbit::from_bits(tmp & UavionixAdsbXbit::all().bits()).ok_or(
39779 ::mavlink_core::error::ParserError::InvalidFlag {
39780 flag_type: "UavionixAdsbXbit",
39781 value: tmp as u32,
39782 },
39783 )?;
39784 Ok(__struct)
39785 }
39786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39787 let mut __tmp = BytesMut::new(bytes);
39788 #[allow(clippy::absurd_extreme_comparisons)]
39789 #[allow(unused_comparisons)]
39790 if __tmp.remaining() < Self::ENCODED_LEN {
39791 panic!(
39792 "buffer is too small (need {} bytes, but got {})",
39793 Self::ENCODED_LEN,
39794 __tmp.remaining(),
39795 )
39796 }
39797 __tmp.put_i32_le(self.baroAltMSL);
39798 __tmp.put_u16_le(self.squawk);
39799 __tmp.put_u8(self.state.bits());
39800 __tmp.put_u8(self.emergencyStatus as u8);
39801 for val in &self.flight_id {
39802 __tmp.put_u8(*val);
39803 }
39804 __tmp.put_u8(self.x_bit.bits());
39805 if matches!(version, MavlinkVersion::V2) {
39806 let len = __tmp.len();
39807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39808 } else {
39809 __tmp.len()
39810 }
39811 }
39812}
39813#[doc = "id: 10002"]
39814#[doc = "Dynamic data used to generate ADS-B out transponder data (send at 5Hz)."]
39815#[derive(Debug, Clone, PartialEq)]
39816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39818pub struct UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
39819 #[doc = "UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX"]
39820 pub utcTime: u32,
39821 #[doc = "Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
39822 pub gpsLat: i32,
39823 #[doc = "Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
39824 pub gpsLon: i32,
39825 #[doc = "Altitude (WGS84). UP +ve. If unknown set to INT32_MAX"]
39826 pub gpsAlt: i32,
39827 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
39828 pub baroAltMSL: i32,
39829 #[doc = "Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX"]
39830 pub accuracyHor: u32,
39831 #[doc = "Vertical accuracy in cm. If unknown set to UINT16_MAX"]
39832 pub accuracyVert: u16,
39833 #[doc = "Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX"]
39834 pub accuracyVel: u16,
39835 #[doc = "GPS vertical speed in cm/s. If unknown set to INT16_MAX"]
39836 pub velVert: i16,
39837 #[doc = "North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX"]
39838 pub velNS: i16,
39839 #[doc = "East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX"]
39840 pub VelEW: i16,
39841 #[doc = "ADS-B transponder dynamic input state flags"]
39842 pub state: UavionixAdsbOutDynamicState,
39843 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
39844 pub squawk: u16,
39845 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK"]
39846 pub gpsFix: UavionixAdsbOutDynamicGpsFix,
39847 #[doc = "Number of satellites visible. If unknown set to UINT8_MAX"]
39848 pub numSats: u8,
39849 #[doc = "Emergency status"]
39850 pub emergencyStatus: UavionixAdsbEmergencyStatus,
39851}
39852impl UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
39853 pub const ENCODED_LEN: usize = 41usize;
39854 pub const DEFAULT: Self = Self {
39855 utcTime: 0_u32,
39856 gpsLat: 0_i32,
39857 gpsLon: 0_i32,
39858 gpsAlt: 0_i32,
39859 baroAltMSL: 0_i32,
39860 accuracyHor: 0_u32,
39861 accuracyVert: 0_u16,
39862 accuracyVel: 0_u16,
39863 velVert: 0_i16,
39864 velNS: 0_i16,
39865 VelEW: 0_i16,
39866 state: UavionixAdsbOutDynamicState::DEFAULT,
39867 squawk: 0_u16,
39868 gpsFix: UavionixAdsbOutDynamicGpsFix::DEFAULT,
39869 numSats: 0_u8,
39870 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
39871 };
39872 #[cfg(feature = "arbitrary")]
39873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
39874 use arbitrary::{Arbitrary, Unstructured};
39875 let mut buf = [0u8; 1024];
39876 rng.fill_bytes(&mut buf);
39877 let mut unstructured = Unstructured::new(&buf);
39878 Self::arbitrary(&mut unstructured).unwrap_or_default()
39879 }
39880}
39881impl Default for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
39882 fn default() -> Self {
39883 Self::DEFAULT.clone()
39884 }
39885}
39886impl MessageData for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
39887 type Message = MavMessage;
39888 const ID: u32 = 10002u32;
39889 const NAME: &'static str = "UAVIONIX_ADSB_OUT_DYNAMIC";
39890 const EXTRA_CRC: u8 = 186u8;
39891 const ENCODED_LEN: usize = 41usize;
39892 fn deser(
39893 _version: MavlinkVersion,
39894 __input: &[u8],
39895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
39896 let avail_len = __input.len();
39897 let mut payload_buf = [0; Self::ENCODED_LEN];
39898 let mut buf = if avail_len < Self::ENCODED_LEN {
39899 payload_buf[0..avail_len].copy_from_slice(__input);
39900 Bytes::new(&payload_buf)
39901 } else {
39902 Bytes::new(__input)
39903 };
39904 let mut __struct = Self::default();
39905 __struct.utcTime = buf.get_u32_le();
39906 __struct.gpsLat = buf.get_i32_le();
39907 __struct.gpsLon = buf.get_i32_le();
39908 __struct.gpsAlt = buf.get_i32_le();
39909 __struct.baroAltMSL = buf.get_i32_le();
39910 __struct.accuracyHor = buf.get_u32_le();
39911 __struct.accuracyVert = buf.get_u16_le();
39912 __struct.accuracyVel = buf.get_u16_le();
39913 __struct.velVert = buf.get_i16_le();
39914 __struct.velNS = buf.get_i16_le();
39915 __struct.VelEW = buf.get_i16_le();
39916 let tmp = buf.get_u16_le();
39917 __struct.state =
39918 UavionixAdsbOutDynamicState::from_bits(tmp & UavionixAdsbOutDynamicState::all().bits())
39919 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
39920 flag_type: "UavionixAdsbOutDynamicState",
39921 value: tmp as u32,
39922 })?;
39923 __struct.squawk = buf.get_u16_le();
39924 let tmp = buf.get_u8();
39925 __struct.gpsFix =
39926 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39927 enum_type: "UavionixAdsbOutDynamicGpsFix",
39928 value: tmp as u32,
39929 })?;
39930 __struct.numSats = buf.get_u8();
39931 let tmp = buf.get_u8();
39932 __struct.emergencyStatus =
39933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
39934 enum_type: "UavionixAdsbEmergencyStatus",
39935 value: tmp as u32,
39936 })?;
39937 Ok(__struct)
39938 }
39939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
39940 let mut __tmp = BytesMut::new(bytes);
39941 #[allow(clippy::absurd_extreme_comparisons)]
39942 #[allow(unused_comparisons)]
39943 if __tmp.remaining() < Self::ENCODED_LEN {
39944 panic!(
39945 "buffer is too small (need {} bytes, but got {})",
39946 Self::ENCODED_LEN,
39947 __tmp.remaining(),
39948 )
39949 }
39950 __tmp.put_u32_le(self.utcTime);
39951 __tmp.put_i32_le(self.gpsLat);
39952 __tmp.put_i32_le(self.gpsLon);
39953 __tmp.put_i32_le(self.gpsAlt);
39954 __tmp.put_i32_le(self.baroAltMSL);
39955 __tmp.put_u32_le(self.accuracyHor);
39956 __tmp.put_u16_le(self.accuracyVert);
39957 __tmp.put_u16_le(self.accuracyVel);
39958 __tmp.put_i16_le(self.velVert);
39959 __tmp.put_i16_le(self.velNS);
39960 __tmp.put_i16_le(self.VelEW);
39961 __tmp.put_u16_le(self.state.bits());
39962 __tmp.put_u16_le(self.squawk);
39963 __tmp.put_u8(self.gpsFix as u8);
39964 __tmp.put_u8(self.numSats);
39965 __tmp.put_u8(self.emergencyStatus as u8);
39966 if matches!(version, MavlinkVersion::V2) {
39967 let len = __tmp.len();
39968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
39969 } else {
39970 __tmp.len()
39971 }
39972 }
39973}
39974#[doc = "id: 10008"]
39975#[doc = "Status message with information from UCP Heartbeat and Status messages."]
39976#[derive(Debug, Clone, PartialEq)]
39977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
39978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
39979pub struct UAVIONIX_ADSB_OUT_STATUS_DATA {
39980 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
39981 pub squawk: u16,
39982 #[doc = "ADS-B transponder status state flags"]
39983 pub state: UavionixAdsbOutStatusState,
39984 #[doc = "Integrity and Accuracy of traffic reported as a 4-bit value for each field (NACp 7:4, NIC 3:0) and encoded by Containment Radius (HPL) and Estimated Position Uncertainty (HFOM), respectively"]
39985 pub NIC_NACp: UavionixAdsbOutStatusNicNacp,
39986 #[doc = "Board temperature in C"]
39987 pub boardTemp: u8,
39988 #[doc = "ADS-B transponder fault flags"]
39989 pub fault: UavionixAdsbOutStatusFault,
39990 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
39991 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
39992 pub flight_id: [u8; 8],
39993}
39994impl UAVIONIX_ADSB_OUT_STATUS_DATA {
39995 pub const ENCODED_LEN: usize = 14usize;
39996 pub const DEFAULT: Self = Self {
39997 squawk: 0_u16,
39998 state: UavionixAdsbOutStatusState::DEFAULT,
39999 NIC_NACp: UavionixAdsbOutStatusNicNacp::DEFAULT,
40000 boardTemp: 0_u8,
40001 fault: UavionixAdsbOutStatusFault::DEFAULT,
40002 flight_id: [0_u8; 8usize],
40003 };
40004 #[cfg(feature = "arbitrary")]
40005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40006 use arbitrary::{Arbitrary, Unstructured};
40007 let mut buf = [0u8; 1024];
40008 rng.fill_bytes(&mut buf);
40009 let mut unstructured = Unstructured::new(&buf);
40010 Self::arbitrary(&mut unstructured).unwrap_or_default()
40011 }
40012}
40013impl Default for UAVIONIX_ADSB_OUT_STATUS_DATA {
40014 fn default() -> Self {
40015 Self::DEFAULT.clone()
40016 }
40017}
40018impl MessageData for UAVIONIX_ADSB_OUT_STATUS_DATA {
40019 type Message = MavMessage;
40020 const ID: u32 = 10008u32;
40021 const NAME: &'static str = "UAVIONIX_ADSB_OUT_STATUS";
40022 const EXTRA_CRC: u8 = 240u8;
40023 const ENCODED_LEN: usize = 14usize;
40024 fn deser(
40025 _version: MavlinkVersion,
40026 __input: &[u8],
40027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40028 let avail_len = __input.len();
40029 let mut payload_buf = [0; Self::ENCODED_LEN];
40030 let mut buf = if avail_len < Self::ENCODED_LEN {
40031 payload_buf[0..avail_len].copy_from_slice(__input);
40032 Bytes::new(&payload_buf)
40033 } else {
40034 Bytes::new(__input)
40035 };
40036 let mut __struct = Self::default();
40037 __struct.squawk = buf.get_u16_le();
40038 let tmp = buf.get_u8();
40039 __struct.state =
40040 UavionixAdsbOutStatusState::from_bits(tmp & UavionixAdsbOutStatusState::all().bits())
40041 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40042 flag_type: "UavionixAdsbOutStatusState",
40043 value: tmp as u32,
40044 })?;
40045 let tmp = buf.get_u8();
40046 __struct.NIC_NACp =
40047 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
40048 enum_type: "UavionixAdsbOutStatusNicNacp",
40049 value: tmp as u32,
40050 })?;
40051 __struct.boardTemp = buf.get_u8();
40052 let tmp = buf.get_u8();
40053 __struct.fault =
40054 UavionixAdsbOutStatusFault::from_bits(tmp & UavionixAdsbOutStatusFault::all().bits())
40055 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40056 flag_type: "UavionixAdsbOutStatusFault",
40057 value: tmp as u32,
40058 })?;
40059 for v in &mut __struct.flight_id {
40060 let val = buf.get_u8();
40061 *v = val;
40062 }
40063 Ok(__struct)
40064 }
40065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40066 let mut __tmp = BytesMut::new(bytes);
40067 #[allow(clippy::absurd_extreme_comparisons)]
40068 #[allow(unused_comparisons)]
40069 if __tmp.remaining() < Self::ENCODED_LEN {
40070 panic!(
40071 "buffer is too small (need {} bytes, but got {})",
40072 Self::ENCODED_LEN,
40073 __tmp.remaining(),
40074 )
40075 }
40076 __tmp.put_u16_le(self.squawk);
40077 __tmp.put_u8(self.state.bits());
40078 __tmp.put_u8(self.NIC_NACp as u8);
40079 __tmp.put_u8(self.boardTemp);
40080 __tmp.put_u8(self.fault.bits());
40081 for val in &self.flight_id {
40082 __tmp.put_u8(*val);
40083 }
40084 if matches!(version, MavlinkVersion::V2) {
40085 let len = __tmp.len();
40086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40087 } else {
40088 __tmp.len()
40089 }
40090 }
40091}
40092#[doc = "id: 10003"]
40093#[doc = "Transceiver heartbeat with health report (updated every 10s)."]
40094#[derive(Debug, Clone, PartialEq)]
40095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40097pub struct UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
40098 #[doc = "ADS-B transponder messages"]
40099 pub rfHealth: UavionixAdsbRfHealth,
40100}
40101impl UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
40102 pub const ENCODED_LEN: usize = 1usize;
40103 pub const DEFAULT: Self = Self {
40104 rfHealth: UavionixAdsbRfHealth::DEFAULT,
40105 };
40106 #[cfg(feature = "arbitrary")]
40107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40108 use arbitrary::{Arbitrary, Unstructured};
40109 let mut buf = [0u8; 1024];
40110 rng.fill_bytes(&mut buf);
40111 let mut unstructured = Unstructured::new(&buf);
40112 Self::arbitrary(&mut unstructured).unwrap_or_default()
40113 }
40114}
40115impl Default for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
40116 fn default() -> Self {
40117 Self::DEFAULT.clone()
40118 }
40119}
40120impl MessageData for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
40121 type Message = MavMessage;
40122 const ID: u32 = 10003u32;
40123 const NAME: &'static str = "UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT";
40124 const EXTRA_CRC: u8 = 4u8;
40125 const ENCODED_LEN: usize = 1usize;
40126 fn deser(
40127 _version: MavlinkVersion,
40128 __input: &[u8],
40129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40130 let avail_len = __input.len();
40131 let mut payload_buf = [0; Self::ENCODED_LEN];
40132 let mut buf = if avail_len < Self::ENCODED_LEN {
40133 payload_buf[0..avail_len].copy_from_slice(__input);
40134 Bytes::new(&payload_buf)
40135 } else {
40136 Bytes::new(__input)
40137 };
40138 let mut __struct = Self::default();
40139 let tmp = buf.get_u8();
40140 __struct.rfHealth = UavionixAdsbRfHealth::from_bits(
40141 tmp & UavionixAdsbRfHealth::all().bits(),
40142 )
40143 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40144 flag_type: "UavionixAdsbRfHealth",
40145 value: tmp as u32,
40146 })?;
40147 Ok(__struct)
40148 }
40149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40150 let mut __tmp = BytesMut::new(bytes);
40151 #[allow(clippy::absurd_extreme_comparisons)]
40152 #[allow(unused_comparisons)]
40153 if __tmp.remaining() < Self::ENCODED_LEN {
40154 panic!(
40155 "buffer is too small (need {} bytes, but got {})",
40156 Self::ENCODED_LEN,
40157 __tmp.remaining(),
40158 )
40159 }
40160 __tmp.put_u8(self.rfHealth.bits());
40161 if matches!(version, MavlinkVersion::V2) {
40162 let len = __tmp.len();
40163 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40164 } else {
40165 __tmp.len()
40166 }
40167 }
40168}
40169#[doc = "id: 340"]
40170#[doc = "The global position resulting from GPS and sensor fusion."]
40171#[derive(Debug, Clone, PartialEq)]
40172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40174pub struct UTM_GLOBAL_POSITION_DATA {
40175 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
40176 pub time: u64,
40177 #[doc = "Latitude (WGS84)"]
40178 pub lat: i32,
40179 #[doc = "Longitude (WGS84)"]
40180 pub lon: i32,
40181 #[doc = "Altitude (WGS84)"]
40182 pub alt: i32,
40183 #[doc = "Altitude above ground"]
40184 pub relative_alt: i32,
40185 #[doc = "Next waypoint, latitude (WGS84)"]
40186 pub next_lat: i32,
40187 #[doc = "Next waypoint, longitude (WGS84)"]
40188 pub next_lon: i32,
40189 #[doc = "Next waypoint, altitude (WGS84)"]
40190 pub next_alt: i32,
40191 #[doc = "Ground X speed (latitude, positive north)"]
40192 pub vx: i16,
40193 #[doc = "Ground Y speed (longitude, positive east)"]
40194 pub vy: i16,
40195 #[doc = "Ground Z speed (altitude, positive down)"]
40196 pub vz: i16,
40197 #[doc = "Horizontal position uncertainty (standard deviation)"]
40198 pub h_acc: u16,
40199 #[doc = "Altitude uncertainty (standard deviation)"]
40200 pub v_acc: u16,
40201 #[doc = "Speed uncertainty (standard deviation)"]
40202 pub vel_acc: u16,
40203 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
40204 pub update_rate: u16,
40205 #[doc = "Unique UAS ID."]
40206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
40207 pub uas_id: [u8; 18],
40208 #[doc = "Flight state"]
40209 pub flight_state: UtmFlightState,
40210 #[doc = "Bitwise OR combination of the data available flags."]
40211 pub flags: UtmDataAvailFlags,
40212}
40213impl UTM_GLOBAL_POSITION_DATA {
40214 pub const ENCODED_LEN: usize = 70usize;
40215 pub const DEFAULT: Self = Self {
40216 time: 0_u64,
40217 lat: 0_i32,
40218 lon: 0_i32,
40219 alt: 0_i32,
40220 relative_alt: 0_i32,
40221 next_lat: 0_i32,
40222 next_lon: 0_i32,
40223 next_alt: 0_i32,
40224 vx: 0_i16,
40225 vy: 0_i16,
40226 vz: 0_i16,
40227 h_acc: 0_u16,
40228 v_acc: 0_u16,
40229 vel_acc: 0_u16,
40230 update_rate: 0_u16,
40231 uas_id: [0_u8; 18usize],
40232 flight_state: UtmFlightState::DEFAULT,
40233 flags: UtmDataAvailFlags::DEFAULT,
40234 };
40235 #[cfg(feature = "arbitrary")]
40236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40237 use arbitrary::{Arbitrary, Unstructured};
40238 let mut buf = [0u8; 1024];
40239 rng.fill_bytes(&mut buf);
40240 let mut unstructured = Unstructured::new(&buf);
40241 Self::arbitrary(&mut unstructured).unwrap_or_default()
40242 }
40243}
40244impl Default for UTM_GLOBAL_POSITION_DATA {
40245 fn default() -> Self {
40246 Self::DEFAULT.clone()
40247 }
40248}
40249impl MessageData for UTM_GLOBAL_POSITION_DATA {
40250 type Message = MavMessage;
40251 const ID: u32 = 340u32;
40252 const NAME: &'static str = "UTM_GLOBAL_POSITION";
40253 const EXTRA_CRC: u8 = 99u8;
40254 const ENCODED_LEN: usize = 70usize;
40255 fn deser(
40256 _version: MavlinkVersion,
40257 __input: &[u8],
40258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40259 let avail_len = __input.len();
40260 let mut payload_buf = [0; Self::ENCODED_LEN];
40261 let mut buf = if avail_len < Self::ENCODED_LEN {
40262 payload_buf[0..avail_len].copy_from_slice(__input);
40263 Bytes::new(&payload_buf)
40264 } else {
40265 Bytes::new(__input)
40266 };
40267 let mut __struct = Self::default();
40268 __struct.time = buf.get_u64_le();
40269 __struct.lat = buf.get_i32_le();
40270 __struct.lon = buf.get_i32_le();
40271 __struct.alt = buf.get_i32_le();
40272 __struct.relative_alt = buf.get_i32_le();
40273 __struct.next_lat = buf.get_i32_le();
40274 __struct.next_lon = buf.get_i32_le();
40275 __struct.next_alt = buf.get_i32_le();
40276 __struct.vx = buf.get_i16_le();
40277 __struct.vy = buf.get_i16_le();
40278 __struct.vz = buf.get_i16_le();
40279 __struct.h_acc = buf.get_u16_le();
40280 __struct.v_acc = buf.get_u16_le();
40281 __struct.vel_acc = buf.get_u16_le();
40282 __struct.update_rate = buf.get_u16_le();
40283 for v in &mut __struct.uas_id {
40284 let val = buf.get_u8();
40285 *v = val;
40286 }
40287 let tmp = buf.get_u8();
40288 __struct.flight_state =
40289 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
40290 enum_type: "UtmFlightState",
40291 value: tmp as u32,
40292 })?;
40293 let tmp = buf.get_u8();
40294 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
40295 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40296 flag_type: "UtmDataAvailFlags",
40297 value: tmp as u32,
40298 })?;
40299 Ok(__struct)
40300 }
40301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40302 let mut __tmp = BytesMut::new(bytes);
40303 #[allow(clippy::absurd_extreme_comparisons)]
40304 #[allow(unused_comparisons)]
40305 if __tmp.remaining() < Self::ENCODED_LEN {
40306 panic!(
40307 "buffer is too small (need {} bytes, but got {})",
40308 Self::ENCODED_LEN,
40309 __tmp.remaining(),
40310 )
40311 }
40312 __tmp.put_u64_le(self.time);
40313 __tmp.put_i32_le(self.lat);
40314 __tmp.put_i32_le(self.lon);
40315 __tmp.put_i32_le(self.alt);
40316 __tmp.put_i32_le(self.relative_alt);
40317 __tmp.put_i32_le(self.next_lat);
40318 __tmp.put_i32_le(self.next_lon);
40319 __tmp.put_i32_le(self.next_alt);
40320 __tmp.put_i16_le(self.vx);
40321 __tmp.put_i16_le(self.vy);
40322 __tmp.put_i16_le(self.vz);
40323 __tmp.put_u16_le(self.h_acc);
40324 __tmp.put_u16_le(self.v_acc);
40325 __tmp.put_u16_le(self.vel_acc);
40326 __tmp.put_u16_le(self.update_rate);
40327 for val in &self.uas_id {
40328 __tmp.put_u8(*val);
40329 }
40330 __tmp.put_u8(self.flight_state as u8);
40331 __tmp.put_u8(self.flags.bits());
40332 if matches!(version, MavlinkVersion::V2) {
40333 let len = __tmp.len();
40334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40335 } else {
40336 __tmp.len()
40337 }
40338 }
40339}
40340#[doc = "id: 248"]
40341#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
40342#[derive(Debug, Clone, PartialEq)]
40343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40345pub struct V2_EXTENSION_DATA {
40346 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
40347 pub message_type: u16,
40348 #[doc = "Network ID (0 for broadcast)"]
40349 pub target_network: u8,
40350 #[doc = "System ID (0 for broadcast)"]
40351 pub target_system: u8,
40352 #[doc = "Component ID (0 for broadcast)"]
40353 pub target_component: u8,
40354 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
40355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
40356 pub payload: [u8; 249],
40357}
40358impl V2_EXTENSION_DATA {
40359 pub const ENCODED_LEN: usize = 254usize;
40360 pub const DEFAULT: Self = Self {
40361 message_type: 0_u16,
40362 target_network: 0_u8,
40363 target_system: 0_u8,
40364 target_component: 0_u8,
40365 payload: [0_u8; 249usize],
40366 };
40367 #[cfg(feature = "arbitrary")]
40368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40369 use arbitrary::{Arbitrary, Unstructured};
40370 let mut buf = [0u8; 1024];
40371 rng.fill_bytes(&mut buf);
40372 let mut unstructured = Unstructured::new(&buf);
40373 Self::arbitrary(&mut unstructured).unwrap_or_default()
40374 }
40375}
40376impl Default for V2_EXTENSION_DATA {
40377 fn default() -> Self {
40378 Self::DEFAULT.clone()
40379 }
40380}
40381impl MessageData for V2_EXTENSION_DATA {
40382 type Message = MavMessage;
40383 const ID: u32 = 248u32;
40384 const NAME: &'static str = "V2_EXTENSION";
40385 const EXTRA_CRC: u8 = 8u8;
40386 const ENCODED_LEN: usize = 254usize;
40387 fn deser(
40388 _version: MavlinkVersion,
40389 __input: &[u8],
40390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40391 let avail_len = __input.len();
40392 let mut payload_buf = [0; Self::ENCODED_LEN];
40393 let mut buf = if avail_len < Self::ENCODED_LEN {
40394 payload_buf[0..avail_len].copy_from_slice(__input);
40395 Bytes::new(&payload_buf)
40396 } else {
40397 Bytes::new(__input)
40398 };
40399 let mut __struct = Self::default();
40400 __struct.message_type = buf.get_u16_le();
40401 __struct.target_network = buf.get_u8();
40402 __struct.target_system = buf.get_u8();
40403 __struct.target_component = buf.get_u8();
40404 for v in &mut __struct.payload {
40405 let val = buf.get_u8();
40406 *v = val;
40407 }
40408 Ok(__struct)
40409 }
40410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40411 let mut __tmp = BytesMut::new(bytes);
40412 #[allow(clippy::absurd_extreme_comparisons)]
40413 #[allow(unused_comparisons)]
40414 if __tmp.remaining() < Self::ENCODED_LEN {
40415 panic!(
40416 "buffer is too small (need {} bytes, but got {})",
40417 Self::ENCODED_LEN,
40418 __tmp.remaining(),
40419 )
40420 }
40421 __tmp.put_u16_le(self.message_type);
40422 __tmp.put_u8(self.target_network);
40423 __tmp.put_u8(self.target_system);
40424 __tmp.put_u8(self.target_component);
40425 for val in &self.payload {
40426 __tmp.put_u8(*val);
40427 }
40428 if matches!(version, MavlinkVersion::V2) {
40429 let len = __tmp.len();
40430 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40431 } else {
40432 __tmp.len()
40433 }
40434 }
40435}
40436#[doc = "id: 74"]
40437#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
40438#[derive(Debug, Clone, PartialEq)]
40439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40441pub struct VFR_HUD_DATA {
40442 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
40443 pub airspeed: f32,
40444 #[doc = "Current ground speed."]
40445 pub groundspeed: f32,
40446 #[doc = "Current altitude (MSL)."]
40447 pub alt: f32,
40448 #[doc = "Current climb rate."]
40449 pub climb: f32,
40450 #[doc = "Current heading in compass units (0-360, 0=north)."]
40451 pub heading: i16,
40452 #[doc = "Current throttle setting (0 to 100)."]
40453 pub throttle: u16,
40454}
40455impl VFR_HUD_DATA {
40456 pub const ENCODED_LEN: usize = 20usize;
40457 pub const DEFAULT: Self = Self {
40458 airspeed: 0.0_f32,
40459 groundspeed: 0.0_f32,
40460 alt: 0.0_f32,
40461 climb: 0.0_f32,
40462 heading: 0_i16,
40463 throttle: 0_u16,
40464 };
40465 #[cfg(feature = "arbitrary")]
40466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40467 use arbitrary::{Arbitrary, Unstructured};
40468 let mut buf = [0u8; 1024];
40469 rng.fill_bytes(&mut buf);
40470 let mut unstructured = Unstructured::new(&buf);
40471 Self::arbitrary(&mut unstructured).unwrap_or_default()
40472 }
40473}
40474impl Default for VFR_HUD_DATA {
40475 fn default() -> Self {
40476 Self::DEFAULT.clone()
40477 }
40478}
40479impl MessageData for VFR_HUD_DATA {
40480 type Message = MavMessage;
40481 const ID: u32 = 74u32;
40482 const NAME: &'static str = "VFR_HUD";
40483 const EXTRA_CRC: u8 = 20u8;
40484 const ENCODED_LEN: usize = 20usize;
40485 fn deser(
40486 _version: MavlinkVersion,
40487 __input: &[u8],
40488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40489 let avail_len = __input.len();
40490 let mut payload_buf = [0; Self::ENCODED_LEN];
40491 let mut buf = if avail_len < Self::ENCODED_LEN {
40492 payload_buf[0..avail_len].copy_from_slice(__input);
40493 Bytes::new(&payload_buf)
40494 } else {
40495 Bytes::new(__input)
40496 };
40497 let mut __struct = Self::default();
40498 __struct.airspeed = buf.get_f32_le();
40499 __struct.groundspeed = buf.get_f32_le();
40500 __struct.alt = buf.get_f32_le();
40501 __struct.climb = buf.get_f32_le();
40502 __struct.heading = buf.get_i16_le();
40503 __struct.throttle = buf.get_u16_le();
40504 Ok(__struct)
40505 }
40506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40507 let mut __tmp = BytesMut::new(bytes);
40508 #[allow(clippy::absurd_extreme_comparisons)]
40509 #[allow(unused_comparisons)]
40510 if __tmp.remaining() < Self::ENCODED_LEN {
40511 panic!(
40512 "buffer is too small (need {} bytes, but got {})",
40513 Self::ENCODED_LEN,
40514 __tmp.remaining(),
40515 )
40516 }
40517 __tmp.put_f32_le(self.airspeed);
40518 __tmp.put_f32_le(self.groundspeed);
40519 __tmp.put_f32_le(self.alt);
40520 __tmp.put_f32_le(self.climb);
40521 __tmp.put_i16_le(self.heading);
40522 __tmp.put_u16_le(self.throttle);
40523 if matches!(version, MavlinkVersion::V2) {
40524 let len = __tmp.len();
40525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40526 } else {
40527 __tmp.len()
40528 }
40529 }
40530}
40531#[doc = "id: 241"]
40532#[doc = "Vibration levels and accelerometer clipping."]
40533#[derive(Debug, Clone, PartialEq)]
40534#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40536pub struct VIBRATION_DATA {
40537 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
40538 pub time_usec: u64,
40539 #[doc = "Vibration levels on X-axis"]
40540 pub vibration_x: f32,
40541 #[doc = "Vibration levels on Y-axis"]
40542 pub vibration_y: f32,
40543 #[doc = "Vibration levels on Z-axis"]
40544 pub vibration_z: f32,
40545 #[doc = "first accelerometer clipping count"]
40546 pub clipping_0: u32,
40547 #[doc = "second accelerometer clipping count"]
40548 pub clipping_1: u32,
40549 #[doc = "third accelerometer clipping count"]
40550 pub clipping_2: u32,
40551}
40552impl VIBRATION_DATA {
40553 pub const ENCODED_LEN: usize = 32usize;
40554 pub const DEFAULT: Self = Self {
40555 time_usec: 0_u64,
40556 vibration_x: 0.0_f32,
40557 vibration_y: 0.0_f32,
40558 vibration_z: 0.0_f32,
40559 clipping_0: 0_u32,
40560 clipping_1: 0_u32,
40561 clipping_2: 0_u32,
40562 };
40563 #[cfg(feature = "arbitrary")]
40564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40565 use arbitrary::{Arbitrary, Unstructured};
40566 let mut buf = [0u8; 1024];
40567 rng.fill_bytes(&mut buf);
40568 let mut unstructured = Unstructured::new(&buf);
40569 Self::arbitrary(&mut unstructured).unwrap_or_default()
40570 }
40571}
40572impl Default for VIBRATION_DATA {
40573 fn default() -> Self {
40574 Self::DEFAULT.clone()
40575 }
40576}
40577impl MessageData for VIBRATION_DATA {
40578 type Message = MavMessage;
40579 const ID: u32 = 241u32;
40580 const NAME: &'static str = "VIBRATION";
40581 const EXTRA_CRC: u8 = 90u8;
40582 const ENCODED_LEN: usize = 32usize;
40583 fn deser(
40584 _version: MavlinkVersion,
40585 __input: &[u8],
40586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40587 let avail_len = __input.len();
40588 let mut payload_buf = [0; Self::ENCODED_LEN];
40589 let mut buf = if avail_len < Self::ENCODED_LEN {
40590 payload_buf[0..avail_len].copy_from_slice(__input);
40591 Bytes::new(&payload_buf)
40592 } else {
40593 Bytes::new(__input)
40594 };
40595 let mut __struct = Self::default();
40596 __struct.time_usec = buf.get_u64_le();
40597 __struct.vibration_x = buf.get_f32_le();
40598 __struct.vibration_y = buf.get_f32_le();
40599 __struct.vibration_z = buf.get_f32_le();
40600 __struct.clipping_0 = buf.get_u32_le();
40601 __struct.clipping_1 = buf.get_u32_le();
40602 __struct.clipping_2 = buf.get_u32_le();
40603 Ok(__struct)
40604 }
40605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40606 let mut __tmp = BytesMut::new(bytes);
40607 #[allow(clippy::absurd_extreme_comparisons)]
40608 #[allow(unused_comparisons)]
40609 if __tmp.remaining() < Self::ENCODED_LEN {
40610 panic!(
40611 "buffer is too small (need {} bytes, but got {})",
40612 Self::ENCODED_LEN,
40613 __tmp.remaining(),
40614 )
40615 }
40616 __tmp.put_u64_le(self.time_usec);
40617 __tmp.put_f32_le(self.vibration_x);
40618 __tmp.put_f32_le(self.vibration_y);
40619 __tmp.put_f32_le(self.vibration_z);
40620 __tmp.put_u32_le(self.clipping_0);
40621 __tmp.put_u32_le(self.clipping_1);
40622 __tmp.put_u32_le(self.clipping_2);
40623 if matches!(version, MavlinkVersion::V2) {
40624 let len = __tmp.len();
40625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40626 } else {
40627 __tmp.len()
40628 }
40629 }
40630}
40631#[doc = "id: 104"]
40632#[doc = "Global position estimate from a Vicon motion system source."]
40633#[derive(Debug, Clone, PartialEq)]
40634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40636pub struct VICON_POSITION_ESTIMATE_DATA {
40637 #[doc = "Timestamp (UNIX time or time since system boot)"]
40638 pub usec: u64,
40639 #[doc = "Global X position"]
40640 pub x: f32,
40641 #[doc = "Global Y position"]
40642 pub y: f32,
40643 #[doc = "Global Z position"]
40644 pub z: f32,
40645 #[doc = "Roll angle"]
40646 pub roll: f32,
40647 #[doc = "Pitch angle"]
40648 pub pitch: f32,
40649 #[doc = "Yaw angle"]
40650 pub yaw: f32,
40651 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
40652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
40653 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
40654 pub covariance: [f32; 21],
40655}
40656impl VICON_POSITION_ESTIMATE_DATA {
40657 pub const ENCODED_LEN: usize = 116usize;
40658 pub const DEFAULT: Self = Self {
40659 usec: 0_u64,
40660 x: 0.0_f32,
40661 y: 0.0_f32,
40662 z: 0.0_f32,
40663 roll: 0.0_f32,
40664 pitch: 0.0_f32,
40665 yaw: 0.0_f32,
40666 covariance: [0.0_f32; 21usize],
40667 };
40668 #[cfg(feature = "arbitrary")]
40669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40670 use arbitrary::{Arbitrary, Unstructured};
40671 let mut buf = [0u8; 1024];
40672 rng.fill_bytes(&mut buf);
40673 let mut unstructured = Unstructured::new(&buf);
40674 Self::arbitrary(&mut unstructured).unwrap_or_default()
40675 }
40676}
40677impl Default for VICON_POSITION_ESTIMATE_DATA {
40678 fn default() -> Self {
40679 Self::DEFAULT.clone()
40680 }
40681}
40682impl MessageData for VICON_POSITION_ESTIMATE_DATA {
40683 type Message = MavMessage;
40684 const ID: u32 = 104u32;
40685 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
40686 const EXTRA_CRC: u8 = 56u8;
40687 const ENCODED_LEN: usize = 116usize;
40688 fn deser(
40689 _version: MavlinkVersion,
40690 __input: &[u8],
40691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40692 let avail_len = __input.len();
40693 let mut payload_buf = [0; Self::ENCODED_LEN];
40694 let mut buf = if avail_len < Self::ENCODED_LEN {
40695 payload_buf[0..avail_len].copy_from_slice(__input);
40696 Bytes::new(&payload_buf)
40697 } else {
40698 Bytes::new(__input)
40699 };
40700 let mut __struct = Self::default();
40701 __struct.usec = buf.get_u64_le();
40702 __struct.x = buf.get_f32_le();
40703 __struct.y = buf.get_f32_le();
40704 __struct.z = buf.get_f32_le();
40705 __struct.roll = buf.get_f32_le();
40706 __struct.pitch = buf.get_f32_le();
40707 __struct.yaw = buf.get_f32_le();
40708 for v in &mut __struct.covariance {
40709 let val = buf.get_f32_le();
40710 *v = val;
40711 }
40712 Ok(__struct)
40713 }
40714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40715 let mut __tmp = BytesMut::new(bytes);
40716 #[allow(clippy::absurd_extreme_comparisons)]
40717 #[allow(unused_comparisons)]
40718 if __tmp.remaining() < Self::ENCODED_LEN {
40719 panic!(
40720 "buffer is too small (need {} bytes, but got {})",
40721 Self::ENCODED_LEN,
40722 __tmp.remaining(),
40723 )
40724 }
40725 __tmp.put_u64_le(self.usec);
40726 __tmp.put_f32_le(self.x);
40727 __tmp.put_f32_le(self.y);
40728 __tmp.put_f32_le(self.z);
40729 __tmp.put_f32_le(self.roll);
40730 __tmp.put_f32_le(self.pitch);
40731 __tmp.put_f32_le(self.yaw);
40732 for val in &self.covariance {
40733 __tmp.put_f32_le(*val);
40734 }
40735 if matches!(version, MavlinkVersion::V2) {
40736 let len = __tmp.len();
40737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40738 } else {
40739 __tmp.len()
40740 }
40741 }
40742}
40743#[doc = "id: 269"]
40744#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
40745#[derive(Debug, Clone, PartialEq)]
40746#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40748pub struct VIDEO_STREAM_INFORMATION_DATA {
40749 #[doc = "Frame rate."]
40750 pub framerate: f32,
40751 #[doc = "Bit rate."]
40752 pub bitrate: u32,
40753 #[doc = "Bitmap of stream status flags."]
40754 pub flags: VideoStreamStatusFlags,
40755 #[doc = "Horizontal resolution."]
40756 pub resolution_h: u16,
40757 #[doc = "Vertical resolution."]
40758 pub resolution_v: u16,
40759 #[doc = "Video image rotation clockwise."]
40760 pub rotation: u16,
40761 #[doc = "Horizontal Field of view."]
40762 pub hfov: u16,
40763 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
40764 pub stream_id: u8,
40765 #[doc = "Number of streams available."]
40766 pub count: u8,
40767 #[doc = "Type of stream."]
40768 pub mavtype: VideoStreamType,
40769 #[doc = "Stream name."]
40770 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
40771 pub name: [u8; 32],
40772 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
40773 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
40774 pub uri: [u8; 160],
40775 #[doc = "Encoding of stream."]
40776 #[cfg_attr(feature = "serde", serde(default))]
40777 pub encoding: VideoStreamEncoding,
40778 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
40779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
40780 pub camera_device_id: u8,
40781}
40782impl VIDEO_STREAM_INFORMATION_DATA {
40783 pub const ENCODED_LEN: usize = 215usize;
40784 pub const DEFAULT: Self = Self {
40785 framerate: 0.0_f32,
40786 bitrate: 0_u32,
40787 flags: VideoStreamStatusFlags::DEFAULT,
40788 resolution_h: 0_u16,
40789 resolution_v: 0_u16,
40790 rotation: 0_u16,
40791 hfov: 0_u16,
40792 stream_id: 0_u8,
40793 count: 0_u8,
40794 mavtype: VideoStreamType::DEFAULT,
40795 name: [0_u8; 32usize],
40796 uri: [0_u8; 160usize],
40797 encoding: VideoStreamEncoding::DEFAULT,
40798 camera_device_id: 0_u8,
40799 };
40800 #[cfg(feature = "arbitrary")]
40801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40802 use arbitrary::{Arbitrary, Unstructured};
40803 let mut buf = [0u8; 1024];
40804 rng.fill_bytes(&mut buf);
40805 let mut unstructured = Unstructured::new(&buf);
40806 Self::arbitrary(&mut unstructured).unwrap_or_default()
40807 }
40808}
40809impl Default for VIDEO_STREAM_INFORMATION_DATA {
40810 fn default() -> Self {
40811 Self::DEFAULT.clone()
40812 }
40813}
40814impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
40815 type Message = MavMessage;
40816 const ID: u32 = 269u32;
40817 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
40818 const EXTRA_CRC: u8 = 109u8;
40819 const ENCODED_LEN: usize = 215usize;
40820 fn deser(
40821 _version: MavlinkVersion,
40822 __input: &[u8],
40823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40824 let avail_len = __input.len();
40825 let mut payload_buf = [0; Self::ENCODED_LEN];
40826 let mut buf = if avail_len < Self::ENCODED_LEN {
40827 payload_buf[0..avail_len].copy_from_slice(__input);
40828 Bytes::new(&payload_buf)
40829 } else {
40830 Bytes::new(__input)
40831 };
40832 let mut __struct = Self::default();
40833 __struct.framerate = buf.get_f32_le();
40834 __struct.bitrate = buf.get_u32_le();
40835 let tmp = buf.get_u16_le();
40836 __struct.flags = VideoStreamStatusFlags::from_bits(
40837 tmp & VideoStreamStatusFlags::all().bits(),
40838 )
40839 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40840 flag_type: "VideoStreamStatusFlags",
40841 value: tmp as u32,
40842 })?;
40843 __struct.resolution_h = buf.get_u16_le();
40844 __struct.resolution_v = buf.get_u16_le();
40845 __struct.rotation = buf.get_u16_le();
40846 __struct.hfov = buf.get_u16_le();
40847 __struct.stream_id = buf.get_u8();
40848 __struct.count = buf.get_u8();
40849 let tmp = buf.get_u8();
40850 __struct.mavtype =
40851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
40852 enum_type: "VideoStreamType",
40853 value: tmp as u32,
40854 })?;
40855 for v in &mut __struct.name {
40856 let val = buf.get_u8();
40857 *v = val;
40858 }
40859 for v in &mut __struct.uri {
40860 let val = buf.get_u8();
40861 *v = val;
40862 }
40863 let tmp = buf.get_u8();
40864 __struct.encoding =
40865 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
40866 enum_type: "VideoStreamEncoding",
40867 value: tmp as u32,
40868 })?;
40869 __struct.camera_device_id = buf.get_u8();
40870 Ok(__struct)
40871 }
40872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
40873 let mut __tmp = BytesMut::new(bytes);
40874 #[allow(clippy::absurd_extreme_comparisons)]
40875 #[allow(unused_comparisons)]
40876 if __tmp.remaining() < Self::ENCODED_LEN {
40877 panic!(
40878 "buffer is too small (need {} bytes, but got {})",
40879 Self::ENCODED_LEN,
40880 __tmp.remaining(),
40881 )
40882 }
40883 __tmp.put_f32_le(self.framerate);
40884 __tmp.put_u32_le(self.bitrate);
40885 __tmp.put_u16_le(self.flags.bits());
40886 __tmp.put_u16_le(self.resolution_h);
40887 __tmp.put_u16_le(self.resolution_v);
40888 __tmp.put_u16_le(self.rotation);
40889 __tmp.put_u16_le(self.hfov);
40890 __tmp.put_u8(self.stream_id);
40891 __tmp.put_u8(self.count);
40892 __tmp.put_u8(self.mavtype as u8);
40893 for val in &self.name {
40894 __tmp.put_u8(*val);
40895 }
40896 for val in &self.uri {
40897 __tmp.put_u8(*val);
40898 }
40899 __tmp.put_u8(self.encoding as u8);
40900 __tmp.put_u8(self.camera_device_id);
40901 if matches!(version, MavlinkVersion::V2) {
40902 let len = __tmp.len();
40903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
40904 } else {
40905 __tmp.len()
40906 }
40907 }
40908}
40909#[doc = "id: 270"]
40910#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
40911#[derive(Debug, Clone, PartialEq)]
40912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
40913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
40914pub struct VIDEO_STREAM_STATUS_DATA {
40915 #[doc = "Frame rate"]
40916 pub framerate: f32,
40917 #[doc = "Bit rate"]
40918 pub bitrate: u32,
40919 #[doc = "Bitmap of stream status flags"]
40920 pub flags: VideoStreamStatusFlags,
40921 #[doc = "Horizontal resolution"]
40922 pub resolution_h: u16,
40923 #[doc = "Vertical resolution"]
40924 pub resolution_v: u16,
40925 #[doc = "Video image rotation clockwise"]
40926 pub rotation: u16,
40927 #[doc = "Horizontal Field of view"]
40928 pub hfov: u16,
40929 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
40930 pub stream_id: u8,
40931 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
40932 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
40933 pub camera_device_id: u8,
40934}
40935impl VIDEO_STREAM_STATUS_DATA {
40936 pub const ENCODED_LEN: usize = 20usize;
40937 pub const DEFAULT: Self = Self {
40938 framerate: 0.0_f32,
40939 bitrate: 0_u32,
40940 flags: VideoStreamStatusFlags::DEFAULT,
40941 resolution_h: 0_u16,
40942 resolution_v: 0_u16,
40943 rotation: 0_u16,
40944 hfov: 0_u16,
40945 stream_id: 0_u8,
40946 camera_device_id: 0_u8,
40947 };
40948 #[cfg(feature = "arbitrary")]
40949 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
40950 use arbitrary::{Arbitrary, Unstructured};
40951 let mut buf = [0u8; 1024];
40952 rng.fill_bytes(&mut buf);
40953 let mut unstructured = Unstructured::new(&buf);
40954 Self::arbitrary(&mut unstructured).unwrap_or_default()
40955 }
40956}
40957impl Default for VIDEO_STREAM_STATUS_DATA {
40958 fn default() -> Self {
40959 Self::DEFAULT.clone()
40960 }
40961}
40962impl MessageData for VIDEO_STREAM_STATUS_DATA {
40963 type Message = MavMessage;
40964 const ID: u32 = 270u32;
40965 const NAME: &'static str = "VIDEO_STREAM_STATUS";
40966 const EXTRA_CRC: u8 = 59u8;
40967 const ENCODED_LEN: usize = 20usize;
40968 fn deser(
40969 _version: MavlinkVersion,
40970 __input: &[u8],
40971 ) -> Result<Self, ::mavlink_core::error::ParserError> {
40972 let avail_len = __input.len();
40973 let mut payload_buf = [0; Self::ENCODED_LEN];
40974 let mut buf = if avail_len < Self::ENCODED_LEN {
40975 payload_buf[0..avail_len].copy_from_slice(__input);
40976 Bytes::new(&payload_buf)
40977 } else {
40978 Bytes::new(__input)
40979 };
40980 let mut __struct = Self::default();
40981 __struct.framerate = buf.get_f32_le();
40982 __struct.bitrate = buf.get_u32_le();
40983 let tmp = buf.get_u16_le();
40984 __struct.flags = VideoStreamStatusFlags::from_bits(
40985 tmp & VideoStreamStatusFlags::all().bits(),
40986 )
40987 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
40988 flag_type: "VideoStreamStatusFlags",
40989 value: tmp as u32,
40990 })?;
40991 __struct.resolution_h = buf.get_u16_le();
40992 __struct.resolution_v = buf.get_u16_le();
40993 __struct.rotation = buf.get_u16_le();
40994 __struct.hfov = buf.get_u16_le();
40995 __struct.stream_id = buf.get_u8();
40996 __struct.camera_device_id = buf.get_u8();
40997 Ok(__struct)
40998 }
40999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41000 let mut __tmp = BytesMut::new(bytes);
41001 #[allow(clippy::absurd_extreme_comparisons)]
41002 #[allow(unused_comparisons)]
41003 if __tmp.remaining() < Self::ENCODED_LEN {
41004 panic!(
41005 "buffer is too small (need {} bytes, but got {})",
41006 Self::ENCODED_LEN,
41007 __tmp.remaining(),
41008 )
41009 }
41010 __tmp.put_f32_le(self.framerate);
41011 __tmp.put_u32_le(self.bitrate);
41012 __tmp.put_u16_le(self.flags.bits());
41013 __tmp.put_u16_le(self.resolution_h);
41014 __tmp.put_u16_le(self.resolution_v);
41015 __tmp.put_u16_le(self.rotation);
41016 __tmp.put_u16_le(self.hfov);
41017 __tmp.put_u8(self.stream_id);
41018 __tmp.put_u8(self.camera_device_id);
41019 if matches!(version, MavlinkVersion::V2) {
41020 let len = __tmp.len();
41021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41022 } else {
41023 __tmp.len()
41024 }
41025 }
41026}
41027#[doc = "id: 11011"]
41028#[doc = "Camera vision based attitude and position deltas."]
41029#[derive(Debug, Clone, PartialEq)]
41030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41032pub struct VISION_POSITION_DELTA_DATA {
41033 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
41034 pub time_usec: u64,
41035 #[doc = "Time since the last reported camera frame."]
41036 pub time_delta_usec: u64,
41037 #[doc = "Defines a rotation vector [roll, pitch, yaw] to the current MAV_FRAME_BODY_FRD from the previous MAV_FRAME_BODY_FRD."]
41038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41039 pub angle_delta: [f32; 3],
41040 #[doc = "Change in position to the current MAV_FRAME_BODY_FRD from the previous FRAME_BODY_FRD rotated to the current MAV_FRAME_BODY_FRD."]
41041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41042 pub position_delta: [f32; 3],
41043 #[doc = "Normalised confidence value from 0 to 100."]
41044 pub confidence: f32,
41045}
41046impl VISION_POSITION_DELTA_DATA {
41047 pub const ENCODED_LEN: usize = 44usize;
41048 pub const DEFAULT: Self = Self {
41049 time_usec: 0_u64,
41050 time_delta_usec: 0_u64,
41051 angle_delta: [0.0_f32; 3usize],
41052 position_delta: [0.0_f32; 3usize],
41053 confidence: 0.0_f32,
41054 };
41055 #[cfg(feature = "arbitrary")]
41056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41057 use arbitrary::{Arbitrary, Unstructured};
41058 let mut buf = [0u8; 1024];
41059 rng.fill_bytes(&mut buf);
41060 let mut unstructured = Unstructured::new(&buf);
41061 Self::arbitrary(&mut unstructured).unwrap_or_default()
41062 }
41063}
41064impl Default for VISION_POSITION_DELTA_DATA {
41065 fn default() -> Self {
41066 Self::DEFAULT.clone()
41067 }
41068}
41069impl MessageData for VISION_POSITION_DELTA_DATA {
41070 type Message = MavMessage;
41071 const ID: u32 = 11011u32;
41072 const NAME: &'static str = "VISION_POSITION_DELTA";
41073 const EXTRA_CRC: u8 = 106u8;
41074 const ENCODED_LEN: usize = 44usize;
41075 fn deser(
41076 _version: MavlinkVersion,
41077 __input: &[u8],
41078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41079 let avail_len = __input.len();
41080 let mut payload_buf = [0; Self::ENCODED_LEN];
41081 let mut buf = if avail_len < Self::ENCODED_LEN {
41082 payload_buf[0..avail_len].copy_from_slice(__input);
41083 Bytes::new(&payload_buf)
41084 } else {
41085 Bytes::new(__input)
41086 };
41087 let mut __struct = Self::default();
41088 __struct.time_usec = buf.get_u64_le();
41089 __struct.time_delta_usec = buf.get_u64_le();
41090 for v in &mut __struct.angle_delta {
41091 let val = buf.get_f32_le();
41092 *v = val;
41093 }
41094 for v in &mut __struct.position_delta {
41095 let val = buf.get_f32_le();
41096 *v = val;
41097 }
41098 __struct.confidence = buf.get_f32_le();
41099 Ok(__struct)
41100 }
41101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41102 let mut __tmp = BytesMut::new(bytes);
41103 #[allow(clippy::absurd_extreme_comparisons)]
41104 #[allow(unused_comparisons)]
41105 if __tmp.remaining() < Self::ENCODED_LEN {
41106 panic!(
41107 "buffer is too small (need {} bytes, but got {})",
41108 Self::ENCODED_LEN,
41109 __tmp.remaining(),
41110 )
41111 }
41112 __tmp.put_u64_le(self.time_usec);
41113 __tmp.put_u64_le(self.time_delta_usec);
41114 for val in &self.angle_delta {
41115 __tmp.put_f32_le(*val);
41116 }
41117 for val in &self.position_delta {
41118 __tmp.put_f32_le(*val);
41119 }
41120 __tmp.put_f32_le(self.confidence);
41121 if matches!(version, MavlinkVersion::V2) {
41122 let len = __tmp.len();
41123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41124 } else {
41125 __tmp.len()
41126 }
41127 }
41128}
41129#[doc = "id: 102"]
41130#[doc = "Local position/attitude estimate from a vision source."]
41131#[derive(Debug, Clone, PartialEq)]
41132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41134pub struct VISION_POSITION_ESTIMATE_DATA {
41135 #[doc = "Timestamp (UNIX time or time since system boot)"]
41136 pub usec: u64,
41137 #[doc = "Local X position"]
41138 pub x: f32,
41139 #[doc = "Local Y position"]
41140 pub y: f32,
41141 #[doc = "Local Z position"]
41142 pub z: f32,
41143 #[doc = "Roll angle"]
41144 pub roll: f32,
41145 #[doc = "Pitch angle"]
41146 pub pitch: f32,
41147 #[doc = "Yaw angle"]
41148 pub yaw: f32,
41149 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
41150 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
41151 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41152 pub covariance: [f32; 21],
41153 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
41154 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
41155 pub reset_counter: u8,
41156}
41157impl VISION_POSITION_ESTIMATE_DATA {
41158 pub const ENCODED_LEN: usize = 117usize;
41159 pub const DEFAULT: Self = Self {
41160 usec: 0_u64,
41161 x: 0.0_f32,
41162 y: 0.0_f32,
41163 z: 0.0_f32,
41164 roll: 0.0_f32,
41165 pitch: 0.0_f32,
41166 yaw: 0.0_f32,
41167 covariance: [0.0_f32; 21usize],
41168 reset_counter: 0_u8,
41169 };
41170 #[cfg(feature = "arbitrary")]
41171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41172 use arbitrary::{Arbitrary, Unstructured};
41173 let mut buf = [0u8; 1024];
41174 rng.fill_bytes(&mut buf);
41175 let mut unstructured = Unstructured::new(&buf);
41176 Self::arbitrary(&mut unstructured).unwrap_or_default()
41177 }
41178}
41179impl Default for VISION_POSITION_ESTIMATE_DATA {
41180 fn default() -> Self {
41181 Self::DEFAULT.clone()
41182 }
41183}
41184impl MessageData for VISION_POSITION_ESTIMATE_DATA {
41185 type Message = MavMessage;
41186 const ID: u32 = 102u32;
41187 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
41188 const EXTRA_CRC: u8 = 158u8;
41189 const ENCODED_LEN: usize = 117usize;
41190 fn deser(
41191 _version: MavlinkVersion,
41192 __input: &[u8],
41193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41194 let avail_len = __input.len();
41195 let mut payload_buf = [0; Self::ENCODED_LEN];
41196 let mut buf = if avail_len < Self::ENCODED_LEN {
41197 payload_buf[0..avail_len].copy_from_slice(__input);
41198 Bytes::new(&payload_buf)
41199 } else {
41200 Bytes::new(__input)
41201 };
41202 let mut __struct = Self::default();
41203 __struct.usec = buf.get_u64_le();
41204 __struct.x = buf.get_f32_le();
41205 __struct.y = buf.get_f32_le();
41206 __struct.z = buf.get_f32_le();
41207 __struct.roll = buf.get_f32_le();
41208 __struct.pitch = buf.get_f32_le();
41209 __struct.yaw = buf.get_f32_le();
41210 for v in &mut __struct.covariance {
41211 let val = buf.get_f32_le();
41212 *v = val;
41213 }
41214 __struct.reset_counter = buf.get_u8();
41215 Ok(__struct)
41216 }
41217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41218 let mut __tmp = BytesMut::new(bytes);
41219 #[allow(clippy::absurd_extreme_comparisons)]
41220 #[allow(unused_comparisons)]
41221 if __tmp.remaining() < Self::ENCODED_LEN {
41222 panic!(
41223 "buffer is too small (need {} bytes, but got {})",
41224 Self::ENCODED_LEN,
41225 __tmp.remaining(),
41226 )
41227 }
41228 __tmp.put_u64_le(self.usec);
41229 __tmp.put_f32_le(self.x);
41230 __tmp.put_f32_le(self.y);
41231 __tmp.put_f32_le(self.z);
41232 __tmp.put_f32_le(self.roll);
41233 __tmp.put_f32_le(self.pitch);
41234 __tmp.put_f32_le(self.yaw);
41235 for val in &self.covariance {
41236 __tmp.put_f32_le(*val);
41237 }
41238 __tmp.put_u8(self.reset_counter);
41239 if matches!(version, MavlinkVersion::V2) {
41240 let len = __tmp.len();
41241 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41242 } else {
41243 __tmp.len()
41244 }
41245 }
41246}
41247#[doc = "id: 103"]
41248#[doc = "Speed estimate from a vision source."]
41249#[derive(Debug, Clone, PartialEq)]
41250#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41252pub struct VISION_SPEED_ESTIMATE_DATA {
41253 #[doc = "Timestamp (UNIX time or time since system boot)"]
41254 pub usec: u64,
41255 #[doc = "Global X speed"]
41256 pub x: f32,
41257 #[doc = "Global Y speed"]
41258 pub y: f32,
41259 #[doc = "Global Z speed"]
41260 pub z: f32,
41261 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
41262 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
41263 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41264 pub covariance: [f32; 9],
41265 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
41266 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
41267 pub reset_counter: u8,
41268}
41269impl VISION_SPEED_ESTIMATE_DATA {
41270 pub const ENCODED_LEN: usize = 57usize;
41271 pub const DEFAULT: Self = Self {
41272 usec: 0_u64,
41273 x: 0.0_f32,
41274 y: 0.0_f32,
41275 z: 0.0_f32,
41276 covariance: [0.0_f32; 9usize],
41277 reset_counter: 0_u8,
41278 };
41279 #[cfg(feature = "arbitrary")]
41280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41281 use arbitrary::{Arbitrary, Unstructured};
41282 let mut buf = [0u8; 1024];
41283 rng.fill_bytes(&mut buf);
41284 let mut unstructured = Unstructured::new(&buf);
41285 Self::arbitrary(&mut unstructured).unwrap_or_default()
41286 }
41287}
41288impl Default for VISION_SPEED_ESTIMATE_DATA {
41289 fn default() -> Self {
41290 Self::DEFAULT.clone()
41291 }
41292}
41293impl MessageData for VISION_SPEED_ESTIMATE_DATA {
41294 type Message = MavMessage;
41295 const ID: u32 = 103u32;
41296 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
41297 const EXTRA_CRC: u8 = 208u8;
41298 const ENCODED_LEN: usize = 57usize;
41299 fn deser(
41300 _version: MavlinkVersion,
41301 __input: &[u8],
41302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41303 let avail_len = __input.len();
41304 let mut payload_buf = [0; Self::ENCODED_LEN];
41305 let mut buf = if avail_len < Self::ENCODED_LEN {
41306 payload_buf[0..avail_len].copy_from_slice(__input);
41307 Bytes::new(&payload_buf)
41308 } else {
41309 Bytes::new(__input)
41310 };
41311 let mut __struct = Self::default();
41312 __struct.usec = buf.get_u64_le();
41313 __struct.x = buf.get_f32_le();
41314 __struct.y = buf.get_f32_le();
41315 __struct.z = buf.get_f32_le();
41316 for v in &mut __struct.covariance {
41317 let val = buf.get_f32_le();
41318 *v = val;
41319 }
41320 __struct.reset_counter = buf.get_u8();
41321 Ok(__struct)
41322 }
41323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41324 let mut __tmp = BytesMut::new(bytes);
41325 #[allow(clippy::absurd_extreme_comparisons)]
41326 #[allow(unused_comparisons)]
41327 if __tmp.remaining() < Self::ENCODED_LEN {
41328 panic!(
41329 "buffer is too small (need {} bytes, but got {})",
41330 Self::ENCODED_LEN,
41331 __tmp.remaining(),
41332 )
41333 }
41334 __tmp.put_u64_le(self.usec);
41335 __tmp.put_f32_le(self.x);
41336 __tmp.put_f32_le(self.y);
41337 __tmp.put_f32_le(self.z);
41338 for val in &self.covariance {
41339 __tmp.put_f32_le(*val);
41340 }
41341 __tmp.put_u8(self.reset_counter);
41342 if matches!(version, MavlinkVersion::V2) {
41343 let len = __tmp.len();
41344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41345 } else {
41346 __tmp.len()
41347 }
41348 }
41349}
41350#[doc = "id: 11038"]
41351#[doc = "Water depth."]
41352#[derive(Debug, Clone, PartialEq)]
41353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41355pub struct WATER_DEPTH_DATA {
41356 #[doc = "Timestamp (time since system boot)"]
41357 pub time_boot_ms: u32,
41358 #[doc = "Latitude"]
41359 pub lat: i32,
41360 #[doc = "Longitude"]
41361 pub lng: i32,
41362 #[doc = "Altitude (MSL) of vehicle"]
41363 pub alt: f32,
41364 #[doc = "Roll angle"]
41365 pub roll: f32,
41366 #[doc = "Pitch angle"]
41367 pub pitch: f32,
41368 #[doc = "Yaw angle"]
41369 pub yaw: f32,
41370 #[doc = "Distance (uncorrected)"]
41371 pub distance: f32,
41372 #[doc = "Water temperature"]
41373 pub temperature: f32,
41374 #[doc = "Onboard ID of the sensor"]
41375 pub id: u8,
41376 #[doc = "Sensor data healthy (0=unhealthy, 1=healthy)"]
41377 pub healthy: u8,
41378}
41379impl WATER_DEPTH_DATA {
41380 pub const ENCODED_LEN: usize = 38usize;
41381 pub const DEFAULT: Self = Self {
41382 time_boot_ms: 0_u32,
41383 lat: 0_i32,
41384 lng: 0_i32,
41385 alt: 0.0_f32,
41386 roll: 0.0_f32,
41387 pitch: 0.0_f32,
41388 yaw: 0.0_f32,
41389 distance: 0.0_f32,
41390 temperature: 0.0_f32,
41391 id: 0_u8,
41392 healthy: 0_u8,
41393 };
41394 #[cfg(feature = "arbitrary")]
41395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41396 use arbitrary::{Arbitrary, Unstructured};
41397 let mut buf = [0u8; 1024];
41398 rng.fill_bytes(&mut buf);
41399 let mut unstructured = Unstructured::new(&buf);
41400 Self::arbitrary(&mut unstructured).unwrap_or_default()
41401 }
41402}
41403impl Default for WATER_DEPTH_DATA {
41404 fn default() -> Self {
41405 Self::DEFAULT.clone()
41406 }
41407}
41408impl MessageData for WATER_DEPTH_DATA {
41409 type Message = MavMessage;
41410 const ID: u32 = 11038u32;
41411 const NAME: &'static str = "WATER_DEPTH";
41412 const EXTRA_CRC: u8 = 47u8;
41413 const ENCODED_LEN: usize = 38usize;
41414 fn deser(
41415 _version: MavlinkVersion,
41416 __input: &[u8],
41417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41418 let avail_len = __input.len();
41419 let mut payload_buf = [0; Self::ENCODED_LEN];
41420 let mut buf = if avail_len < Self::ENCODED_LEN {
41421 payload_buf[0..avail_len].copy_from_slice(__input);
41422 Bytes::new(&payload_buf)
41423 } else {
41424 Bytes::new(__input)
41425 };
41426 let mut __struct = Self::default();
41427 __struct.time_boot_ms = buf.get_u32_le();
41428 __struct.lat = buf.get_i32_le();
41429 __struct.lng = buf.get_i32_le();
41430 __struct.alt = buf.get_f32_le();
41431 __struct.roll = buf.get_f32_le();
41432 __struct.pitch = buf.get_f32_le();
41433 __struct.yaw = buf.get_f32_le();
41434 __struct.distance = buf.get_f32_le();
41435 __struct.temperature = buf.get_f32_le();
41436 __struct.id = buf.get_u8();
41437 __struct.healthy = buf.get_u8();
41438 Ok(__struct)
41439 }
41440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41441 let mut __tmp = BytesMut::new(bytes);
41442 #[allow(clippy::absurd_extreme_comparisons)]
41443 #[allow(unused_comparisons)]
41444 if __tmp.remaining() < Self::ENCODED_LEN {
41445 panic!(
41446 "buffer is too small (need {} bytes, but got {})",
41447 Self::ENCODED_LEN,
41448 __tmp.remaining(),
41449 )
41450 }
41451 __tmp.put_u32_le(self.time_boot_ms);
41452 __tmp.put_i32_le(self.lat);
41453 __tmp.put_i32_le(self.lng);
41454 __tmp.put_f32_le(self.alt);
41455 __tmp.put_f32_le(self.roll);
41456 __tmp.put_f32_le(self.pitch);
41457 __tmp.put_f32_le(self.yaw);
41458 __tmp.put_f32_le(self.distance);
41459 __tmp.put_f32_le(self.temperature);
41460 __tmp.put_u8(self.id);
41461 __tmp.put_u8(self.healthy);
41462 if matches!(version, MavlinkVersion::V2) {
41463 let len = __tmp.len();
41464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41465 } else {
41466 __tmp.len()
41467 }
41468 }
41469}
41470#[doc = "id: 9000"]
41471#[doc = "Cumulative distance traveled for each reported wheel."]
41472#[derive(Debug, Clone, PartialEq)]
41473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41475pub struct WHEEL_DISTANCE_DATA {
41476 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
41477 pub time_usec: u64,
41478 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
41479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41480 pub distance: [f64; 16],
41481 #[doc = "Number of wheels reported."]
41482 pub count: u8,
41483}
41484impl WHEEL_DISTANCE_DATA {
41485 pub const ENCODED_LEN: usize = 137usize;
41486 pub const DEFAULT: Self = Self {
41487 time_usec: 0_u64,
41488 distance: [0.0_f64; 16usize],
41489 count: 0_u8,
41490 };
41491 #[cfg(feature = "arbitrary")]
41492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41493 use arbitrary::{Arbitrary, Unstructured};
41494 let mut buf = [0u8; 1024];
41495 rng.fill_bytes(&mut buf);
41496 let mut unstructured = Unstructured::new(&buf);
41497 Self::arbitrary(&mut unstructured).unwrap_or_default()
41498 }
41499}
41500impl Default for WHEEL_DISTANCE_DATA {
41501 fn default() -> Self {
41502 Self::DEFAULT.clone()
41503 }
41504}
41505impl MessageData for WHEEL_DISTANCE_DATA {
41506 type Message = MavMessage;
41507 const ID: u32 = 9000u32;
41508 const NAME: &'static str = "WHEEL_DISTANCE";
41509 const EXTRA_CRC: u8 = 113u8;
41510 const ENCODED_LEN: usize = 137usize;
41511 fn deser(
41512 _version: MavlinkVersion,
41513 __input: &[u8],
41514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41515 let avail_len = __input.len();
41516 let mut payload_buf = [0; Self::ENCODED_LEN];
41517 let mut buf = if avail_len < Self::ENCODED_LEN {
41518 payload_buf[0..avail_len].copy_from_slice(__input);
41519 Bytes::new(&payload_buf)
41520 } else {
41521 Bytes::new(__input)
41522 };
41523 let mut __struct = Self::default();
41524 __struct.time_usec = buf.get_u64_le();
41525 for v in &mut __struct.distance {
41526 let val = buf.get_f64_le();
41527 *v = val;
41528 }
41529 __struct.count = buf.get_u8();
41530 Ok(__struct)
41531 }
41532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41533 let mut __tmp = BytesMut::new(bytes);
41534 #[allow(clippy::absurd_extreme_comparisons)]
41535 #[allow(unused_comparisons)]
41536 if __tmp.remaining() < Self::ENCODED_LEN {
41537 panic!(
41538 "buffer is too small (need {} bytes, but got {})",
41539 Self::ENCODED_LEN,
41540 __tmp.remaining(),
41541 )
41542 }
41543 __tmp.put_u64_le(self.time_usec);
41544 for val in &self.distance {
41545 __tmp.put_f64_le(*val);
41546 }
41547 __tmp.put_u8(self.count);
41548 if matches!(version, MavlinkVersion::V2) {
41549 let len = __tmp.len();
41550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41551 } else {
41552 __tmp.len()
41553 }
41554 }
41555}
41556#[doc = "id: 299"]
41557#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
41558#[derive(Debug, Clone, PartialEq)]
41559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41561pub struct WIFI_CONFIG_AP_DATA {
41562 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
41563 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41564 pub ssid: [u8; 32],
41565 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
41566 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
41567 pub password: [u8; 64],
41568 #[doc = "WiFi Mode."]
41569 #[cfg_attr(feature = "serde", serde(default))]
41570 pub mode: WifiConfigApMode,
41571 #[doc = "Message acceptance response (sent back to GS)."]
41572 #[cfg_attr(feature = "serde", serde(default))]
41573 pub response: WifiConfigApResponse,
41574}
41575impl WIFI_CONFIG_AP_DATA {
41576 pub const ENCODED_LEN: usize = 98usize;
41577 pub const DEFAULT: Self = Self {
41578 ssid: [0_u8; 32usize],
41579 password: [0_u8; 64usize],
41580 mode: WifiConfigApMode::DEFAULT,
41581 response: WifiConfigApResponse::DEFAULT,
41582 };
41583 #[cfg(feature = "arbitrary")]
41584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41585 use arbitrary::{Arbitrary, Unstructured};
41586 let mut buf = [0u8; 1024];
41587 rng.fill_bytes(&mut buf);
41588 let mut unstructured = Unstructured::new(&buf);
41589 Self::arbitrary(&mut unstructured).unwrap_or_default()
41590 }
41591}
41592impl Default for WIFI_CONFIG_AP_DATA {
41593 fn default() -> Self {
41594 Self::DEFAULT.clone()
41595 }
41596}
41597impl MessageData for WIFI_CONFIG_AP_DATA {
41598 type Message = MavMessage;
41599 const ID: u32 = 299u32;
41600 const NAME: &'static str = "WIFI_CONFIG_AP";
41601 const EXTRA_CRC: u8 = 19u8;
41602 const ENCODED_LEN: usize = 98usize;
41603 fn deser(
41604 _version: MavlinkVersion,
41605 __input: &[u8],
41606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41607 let avail_len = __input.len();
41608 let mut payload_buf = [0; Self::ENCODED_LEN];
41609 let mut buf = if avail_len < Self::ENCODED_LEN {
41610 payload_buf[0..avail_len].copy_from_slice(__input);
41611 Bytes::new(&payload_buf)
41612 } else {
41613 Bytes::new(__input)
41614 };
41615 let mut __struct = Self::default();
41616 for v in &mut __struct.ssid {
41617 let val = buf.get_u8();
41618 *v = val;
41619 }
41620 for v in &mut __struct.password {
41621 let val = buf.get_u8();
41622 *v = val;
41623 }
41624 let tmp = buf.get_i8();
41625 __struct.mode =
41626 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
41627 enum_type: "WifiConfigApMode",
41628 value: tmp as u32,
41629 })?;
41630 let tmp = buf.get_i8();
41631 __struct.response =
41632 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
41633 enum_type: "WifiConfigApResponse",
41634 value: tmp as u32,
41635 })?;
41636 Ok(__struct)
41637 }
41638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41639 let mut __tmp = BytesMut::new(bytes);
41640 #[allow(clippy::absurd_extreme_comparisons)]
41641 #[allow(unused_comparisons)]
41642 if __tmp.remaining() < Self::ENCODED_LEN {
41643 panic!(
41644 "buffer is too small (need {} bytes, but got {})",
41645 Self::ENCODED_LEN,
41646 __tmp.remaining(),
41647 )
41648 }
41649 for val in &self.ssid {
41650 __tmp.put_u8(*val);
41651 }
41652 for val in &self.password {
41653 __tmp.put_u8(*val);
41654 }
41655 __tmp.put_i8(self.mode as i8);
41656 __tmp.put_i8(self.response as i8);
41657 if matches!(version, MavlinkVersion::V2) {
41658 let len = __tmp.len();
41659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41660 } else {
41661 __tmp.len()
41662 }
41663 }
41664}
41665#[doc = "id: 9005"]
41666#[doc = "Winch status."]
41667#[derive(Debug, Clone, PartialEq)]
41668#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41670pub struct WINCH_STATUS_DATA {
41671 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
41672 pub time_usec: u64,
41673 #[doc = "Length of line released. NaN if unknown"]
41674 pub line_length: f32,
41675 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
41676 pub speed: f32,
41677 #[doc = "Tension on the line. NaN if unknown"]
41678 pub tension: f32,
41679 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
41680 pub voltage: f32,
41681 #[doc = "Current draw from the winch. NaN if unknown"]
41682 pub current: f32,
41683 #[doc = "Status flags"]
41684 pub status: MavWinchStatusFlag,
41685 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
41686 pub temperature: i16,
41687}
41688impl WINCH_STATUS_DATA {
41689 pub const ENCODED_LEN: usize = 34usize;
41690 pub const DEFAULT: Self = Self {
41691 time_usec: 0_u64,
41692 line_length: 0.0_f32,
41693 speed: 0.0_f32,
41694 tension: 0.0_f32,
41695 voltage: 0.0_f32,
41696 current: 0.0_f32,
41697 status: MavWinchStatusFlag::DEFAULT,
41698 temperature: 0_i16,
41699 };
41700 #[cfg(feature = "arbitrary")]
41701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41702 use arbitrary::{Arbitrary, Unstructured};
41703 let mut buf = [0u8; 1024];
41704 rng.fill_bytes(&mut buf);
41705 let mut unstructured = Unstructured::new(&buf);
41706 Self::arbitrary(&mut unstructured).unwrap_or_default()
41707 }
41708}
41709impl Default for WINCH_STATUS_DATA {
41710 fn default() -> Self {
41711 Self::DEFAULT.clone()
41712 }
41713}
41714impl MessageData for WINCH_STATUS_DATA {
41715 type Message = MavMessage;
41716 const ID: u32 = 9005u32;
41717 const NAME: &'static str = "WINCH_STATUS";
41718 const EXTRA_CRC: u8 = 117u8;
41719 const ENCODED_LEN: usize = 34usize;
41720 fn deser(
41721 _version: MavlinkVersion,
41722 __input: &[u8],
41723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41724 let avail_len = __input.len();
41725 let mut payload_buf = [0; Self::ENCODED_LEN];
41726 let mut buf = if avail_len < Self::ENCODED_LEN {
41727 payload_buf[0..avail_len].copy_from_slice(__input);
41728 Bytes::new(&payload_buf)
41729 } else {
41730 Bytes::new(__input)
41731 };
41732 let mut __struct = Self::default();
41733 __struct.time_usec = buf.get_u64_le();
41734 __struct.line_length = buf.get_f32_le();
41735 __struct.speed = buf.get_f32_le();
41736 __struct.tension = buf.get_f32_le();
41737 __struct.voltage = buf.get_f32_le();
41738 __struct.current = buf.get_f32_le();
41739 let tmp = buf.get_u32_le();
41740 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
41741 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
41742 flag_type: "MavWinchStatusFlag",
41743 value: tmp as u32,
41744 })?;
41745 __struct.temperature = buf.get_i16_le();
41746 Ok(__struct)
41747 }
41748 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41749 let mut __tmp = BytesMut::new(bytes);
41750 #[allow(clippy::absurd_extreme_comparisons)]
41751 #[allow(unused_comparisons)]
41752 if __tmp.remaining() < Self::ENCODED_LEN {
41753 panic!(
41754 "buffer is too small (need {} bytes, but got {})",
41755 Self::ENCODED_LEN,
41756 __tmp.remaining(),
41757 )
41758 }
41759 __tmp.put_u64_le(self.time_usec);
41760 __tmp.put_f32_le(self.line_length);
41761 __tmp.put_f32_le(self.speed);
41762 __tmp.put_f32_le(self.tension);
41763 __tmp.put_f32_le(self.voltage);
41764 __tmp.put_f32_le(self.current);
41765 __tmp.put_u32_le(self.status.bits());
41766 __tmp.put_i16_le(self.temperature);
41767 if matches!(version, MavlinkVersion::V2) {
41768 let len = __tmp.len();
41769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41770 } else {
41771 __tmp.len()
41772 }
41773 }
41774}
41775#[doc = "id: 168"]
41776#[doc = "Wind estimation."]
41777#[derive(Debug, Clone, PartialEq)]
41778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41780pub struct WIND_DATA {
41781 #[doc = "Wind direction (that wind is coming from)."]
41782 pub direction: f32,
41783 #[doc = "Wind speed in ground plane."]
41784 pub speed: f32,
41785 #[doc = "Vertical wind speed."]
41786 pub speed_z: f32,
41787}
41788impl WIND_DATA {
41789 pub const ENCODED_LEN: usize = 12usize;
41790 pub const DEFAULT: Self = Self {
41791 direction: 0.0_f32,
41792 speed: 0.0_f32,
41793 speed_z: 0.0_f32,
41794 };
41795 #[cfg(feature = "arbitrary")]
41796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41797 use arbitrary::{Arbitrary, Unstructured};
41798 let mut buf = [0u8; 1024];
41799 rng.fill_bytes(&mut buf);
41800 let mut unstructured = Unstructured::new(&buf);
41801 Self::arbitrary(&mut unstructured).unwrap_or_default()
41802 }
41803}
41804impl Default for WIND_DATA {
41805 fn default() -> Self {
41806 Self::DEFAULT.clone()
41807 }
41808}
41809impl MessageData for WIND_DATA {
41810 type Message = MavMessage;
41811 const ID: u32 = 168u32;
41812 const NAME: &'static str = "WIND";
41813 const EXTRA_CRC: u8 = 1u8;
41814 const ENCODED_LEN: usize = 12usize;
41815 fn deser(
41816 _version: MavlinkVersion,
41817 __input: &[u8],
41818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41819 let avail_len = __input.len();
41820 let mut payload_buf = [0; Self::ENCODED_LEN];
41821 let mut buf = if avail_len < Self::ENCODED_LEN {
41822 payload_buf[0..avail_len].copy_from_slice(__input);
41823 Bytes::new(&payload_buf)
41824 } else {
41825 Bytes::new(__input)
41826 };
41827 let mut __struct = Self::default();
41828 __struct.direction = buf.get_f32_le();
41829 __struct.speed = buf.get_f32_le();
41830 __struct.speed_z = buf.get_f32_le();
41831 Ok(__struct)
41832 }
41833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41834 let mut __tmp = BytesMut::new(bytes);
41835 #[allow(clippy::absurd_extreme_comparisons)]
41836 #[allow(unused_comparisons)]
41837 if __tmp.remaining() < Self::ENCODED_LEN {
41838 panic!(
41839 "buffer is too small (need {} bytes, but got {})",
41840 Self::ENCODED_LEN,
41841 __tmp.remaining(),
41842 )
41843 }
41844 __tmp.put_f32_le(self.direction);
41845 __tmp.put_f32_le(self.speed);
41846 __tmp.put_f32_le(self.speed_z);
41847 if matches!(version, MavlinkVersion::V2) {
41848 let len = __tmp.len();
41849 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41850 } else {
41851 __tmp.len()
41852 }
41853 }
41854}
41855#[doc = "id: 231"]
41856#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
41857#[derive(Debug, Clone, PartialEq)]
41858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41860pub struct WIND_COV_DATA {
41861 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
41862 pub time_usec: u64,
41863 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
41864 pub wind_x: f32,
41865 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
41866 pub wind_y: f32,
41867 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
41868 pub wind_z: f32,
41869 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
41870 pub var_horiz: f32,
41871 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
41872 pub var_vert: f32,
41873 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
41874 pub wind_alt: f32,
41875 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
41876 pub horiz_accuracy: f32,
41877 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
41878 pub vert_accuracy: f32,
41879}
41880impl WIND_COV_DATA {
41881 pub const ENCODED_LEN: usize = 40usize;
41882 pub const DEFAULT: Self = Self {
41883 time_usec: 0_u64,
41884 wind_x: 0.0_f32,
41885 wind_y: 0.0_f32,
41886 wind_z: 0.0_f32,
41887 var_horiz: 0.0_f32,
41888 var_vert: 0.0_f32,
41889 wind_alt: 0.0_f32,
41890 horiz_accuracy: 0.0_f32,
41891 vert_accuracy: 0.0_f32,
41892 };
41893 #[cfg(feature = "arbitrary")]
41894 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
41895 use arbitrary::{Arbitrary, Unstructured};
41896 let mut buf = [0u8; 1024];
41897 rng.fill_bytes(&mut buf);
41898 let mut unstructured = Unstructured::new(&buf);
41899 Self::arbitrary(&mut unstructured).unwrap_or_default()
41900 }
41901}
41902impl Default for WIND_COV_DATA {
41903 fn default() -> Self {
41904 Self::DEFAULT.clone()
41905 }
41906}
41907impl MessageData for WIND_COV_DATA {
41908 type Message = MavMessage;
41909 const ID: u32 = 231u32;
41910 const NAME: &'static str = "WIND_COV";
41911 const EXTRA_CRC: u8 = 105u8;
41912 const ENCODED_LEN: usize = 40usize;
41913 fn deser(
41914 _version: MavlinkVersion,
41915 __input: &[u8],
41916 ) -> Result<Self, ::mavlink_core::error::ParserError> {
41917 let avail_len = __input.len();
41918 let mut payload_buf = [0; Self::ENCODED_LEN];
41919 let mut buf = if avail_len < Self::ENCODED_LEN {
41920 payload_buf[0..avail_len].copy_from_slice(__input);
41921 Bytes::new(&payload_buf)
41922 } else {
41923 Bytes::new(__input)
41924 };
41925 let mut __struct = Self::default();
41926 __struct.time_usec = buf.get_u64_le();
41927 __struct.wind_x = buf.get_f32_le();
41928 __struct.wind_y = buf.get_f32_le();
41929 __struct.wind_z = buf.get_f32_le();
41930 __struct.var_horiz = buf.get_f32_le();
41931 __struct.var_vert = buf.get_f32_le();
41932 __struct.wind_alt = buf.get_f32_le();
41933 __struct.horiz_accuracy = buf.get_f32_le();
41934 __struct.vert_accuracy = buf.get_f32_le();
41935 Ok(__struct)
41936 }
41937 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
41938 let mut __tmp = BytesMut::new(bytes);
41939 #[allow(clippy::absurd_extreme_comparisons)]
41940 #[allow(unused_comparisons)]
41941 if __tmp.remaining() < Self::ENCODED_LEN {
41942 panic!(
41943 "buffer is too small (need {} bytes, but got {})",
41944 Self::ENCODED_LEN,
41945 __tmp.remaining(),
41946 )
41947 }
41948 __tmp.put_u64_le(self.time_usec);
41949 __tmp.put_f32_le(self.wind_x);
41950 __tmp.put_f32_le(self.wind_y);
41951 __tmp.put_f32_le(self.wind_z);
41952 __tmp.put_f32_le(self.var_horiz);
41953 __tmp.put_f32_le(self.var_vert);
41954 __tmp.put_f32_le(self.wind_alt);
41955 __tmp.put_f32_le(self.horiz_accuracy);
41956 __tmp.put_f32_le(self.vert_accuracy);
41957 if matches!(version, MavlinkVersion::V2) {
41958 let len = __tmp.len();
41959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
41960 } else {
41961 __tmp.len()
41962 }
41963 }
41964}
41965#[derive(Clone, PartialEq, Debug)]
41966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
41967#[cfg_attr(feature = "serde", serde(tag = "type"))]
41968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
41969#[repr(u32)]
41970pub enum MavMessage {
41971 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
41972 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
41973 ADAP_TUNING(ADAP_TUNING_DATA),
41974 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
41975 AHRS(AHRS_DATA),
41976 AHRS2(AHRS2_DATA),
41977 AHRS3(AHRS3_DATA),
41978 AIRLINK_AUTH(AIRLINK_AUTH_DATA),
41979 AIRLINK_AUTH_RESPONSE(AIRLINK_AUTH_RESPONSE_DATA),
41980 AIRSPEED_AUTOCAL(AIRSPEED_AUTOCAL_DATA),
41981 AIS_VESSEL(AIS_VESSEL_DATA),
41982 ALTITUDE(ALTITUDE_DATA),
41983 AOA_SSA(AOA_SSA_DATA),
41984 AP_ADC(AP_ADC_DATA),
41985 ATTITUDE(ATTITUDE_DATA),
41986 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
41987 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
41988 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
41989 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
41990 AUTH_KEY(AUTH_KEY_DATA),
41991 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
41992 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
41993 AUTOPILOT_VERSION_REQUEST(AUTOPILOT_VERSION_REQUEST_DATA),
41994 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
41995 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
41996 #[deprecated = " See `BATTERY_STATUS` (Deprecated since 2017-04)"]
41997 BATTERY2(BATTERY2_DATA),
41998 BATTERY_INFO(BATTERY_INFO_DATA),
41999 BATTERY_STATUS(BATTERY_STATUS_DATA),
42000 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
42001 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
42002 CAMERA_FEEDBACK(CAMERA_FEEDBACK_DATA),
42003 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
42004 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
42005 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
42006 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
42007 CAMERA_STATUS(CAMERA_STATUS_DATA),
42008 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
42009 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
42010 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
42011 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
42012 CANFD_FRAME(CANFD_FRAME_DATA),
42013 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
42014 CAN_FRAME(CAN_FRAME_DATA),
42015 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
42016 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
42017 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
42018 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
42019 COLLISION(COLLISION_DATA),
42020 COMMAND_ACK(COMMAND_ACK_DATA),
42021 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
42022 COMMAND_INT(COMMAND_INT_DATA),
42023 COMMAND_LONG(COMMAND_LONG_DATA),
42024 COMPASSMOT_STATUS(COMPASSMOT_STATUS_DATA),
42025 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
42026 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
42027 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
42028 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
42029 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
42030 CUBEPILOT_FIRMWARE_UPDATE_RESP(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA),
42031 CUBEPILOT_FIRMWARE_UPDATE_START(CUBEPILOT_FIRMWARE_UPDATE_START_DATA),
42032 CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA),
42033 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
42034 CURRENT_MODE(CURRENT_MODE_DATA),
42035 DATA16(DATA16_DATA),
42036 DATA32(DATA32_DATA),
42037 DATA64(DATA64_DATA),
42038 DATA96(DATA96_DATA),
42039 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
42040 DATA_STREAM(DATA_STREAM_DATA),
42041 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
42042 DEBUG(DEBUG_DATA),
42043 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
42044 DEBUG_VECT(DEBUG_VECT_DATA),
42045 DEEPSTALL(DEEPSTALL_DATA),
42046 DEVICE_OP_READ(DEVICE_OP_READ_DATA),
42047 DEVICE_OP_READ_REPLY(DEVICE_OP_READ_REPLY_DATA),
42048 DEVICE_OP_WRITE(DEVICE_OP_WRITE_DATA),
42049 DEVICE_OP_WRITE_REPLY(DEVICE_OP_WRITE_REPLY_DATA),
42050 DIGICAM_CONFIGURE(DIGICAM_CONFIGURE_DATA),
42051 DIGICAM_CONTROL(DIGICAM_CONTROL_DATA),
42052 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
42053 EFI_STATUS(EFI_STATUS_DATA),
42054 EKF_STATUS_REPORT(EKF_STATUS_REPORT_DATA),
42055 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
42056 ESC_INFO(ESC_INFO_DATA),
42057 ESC_STATUS(ESC_STATUS_DATA),
42058 ESC_TELEMETRY_13_TO_16(ESC_TELEMETRY_13_TO_16_DATA),
42059 ESC_TELEMETRY_17_TO_20(ESC_TELEMETRY_17_TO_20_DATA),
42060 ESC_TELEMETRY_1_TO_4(ESC_TELEMETRY_1_TO_4_DATA),
42061 ESC_TELEMETRY_21_TO_24(ESC_TELEMETRY_21_TO_24_DATA),
42062 ESC_TELEMETRY_25_TO_28(ESC_TELEMETRY_25_TO_28_DATA),
42063 ESC_TELEMETRY_29_TO_32(ESC_TELEMETRY_29_TO_32_DATA),
42064 ESC_TELEMETRY_5_TO_8(ESC_TELEMETRY_5_TO_8_DATA),
42065 ESC_TELEMETRY_9_TO_12(ESC_TELEMETRY_9_TO_12_DATA),
42066 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
42067 EVENT(EVENT_DATA),
42068 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
42069 FENCE_FETCH_POINT(FENCE_FETCH_POINT_DATA),
42070 FENCE_POINT(FENCE_POINT_DATA),
42071 FENCE_STATUS(FENCE_STATUS_DATA),
42072 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
42073 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
42074 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
42075 FUEL_STATUS(FUEL_STATUS_DATA),
42076 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
42077 GIMBAL_CONTROL(GIMBAL_CONTROL_DATA),
42078 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
42079 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
42080 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
42081 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
42082 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
42083 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
42084 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
42085 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
42086 GIMBAL_REPORT(GIMBAL_REPORT_DATA),
42087 GIMBAL_TORQUE_CMD_REPORT(GIMBAL_TORQUE_CMD_REPORT_DATA),
42088 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
42089 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
42090 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
42091 GOPRO_GET_REQUEST(GOPRO_GET_REQUEST_DATA),
42092 GOPRO_GET_RESPONSE(GOPRO_GET_RESPONSE_DATA),
42093 GOPRO_HEARTBEAT(GOPRO_HEARTBEAT_DATA),
42094 GOPRO_SET_REQUEST(GOPRO_SET_REQUEST_DATA),
42095 GOPRO_SET_RESPONSE(GOPRO_SET_RESPONSE_DATA),
42096 GPS2_RAW(GPS2_RAW_DATA),
42097 GPS2_RTK(GPS2_RTK_DATA),
42098 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
42099 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
42100 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
42101 GPS_INPUT(GPS_INPUT_DATA),
42102 GPS_RAW_INT(GPS_RAW_INT_DATA),
42103 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
42104 GPS_RTK(GPS_RTK_DATA),
42105 GPS_STATUS(GPS_STATUS_DATA),
42106 HEARTBEAT(HEARTBEAT_DATA),
42107 HERELINK_TELEM(HERELINK_TELEM_DATA),
42108 HERELINK_VIDEO_STREAM_INFORMATION(HERELINK_VIDEO_STREAM_INFORMATION_DATA),
42109 HIGHRES_IMU(HIGHRES_IMU_DATA),
42110 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
42111 HIGH_LATENCY(HIGH_LATENCY_DATA),
42112 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
42113 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
42114 HIL_CONTROLS(HIL_CONTROLS_DATA),
42115 HIL_GPS(HIL_GPS_DATA),
42116 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
42117 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
42118 HIL_SENSOR(HIL_SENSOR_DATA),
42119 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
42120 HIL_STATE(HIL_STATE_DATA),
42121 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
42122 HOME_POSITION(HOME_POSITION_DATA),
42123 HWSTATUS(HWSTATUS_DATA),
42124 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
42125 ICAROUS_HEARTBEAT(ICAROUS_HEARTBEAT_DATA),
42126 ICAROUS_KINEMATIC_BANDS(ICAROUS_KINEMATIC_BANDS_DATA),
42127 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
42128 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
42129 LANDING_TARGET(LANDING_TARGET_DATA),
42130 LED_CONTROL(LED_CONTROL_DATA),
42131 LIMITS_STATUS(LIMITS_STATUS_DATA),
42132 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
42133 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
42134 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
42135 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
42136 LOGGING_ACK(LOGGING_ACK_DATA),
42137 LOGGING_DATA(LOGGING_DATA_DATA),
42138 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
42139 LOG_DATA(LOG_DATA_DATA),
42140 LOG_ENTRY(LOG_ENTRY_DATA),
42141 LOG_ERASE(LOG_ERASE_DATA),
42142 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
42143 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
42144 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
42145 LOWEHEISER_GOV_EFI(LOWEHEISER_GOV_EFI_DATA),
42146 MAG_CAL_PROGRESS(MAG_CAL_PROGRESS_DATA),
42147 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
42148 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
42149 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
42150 MCU_STATUS(MCU_STATUS_DATA),
42151 MEMINFO(MEMINFO_DATA),
42152 MEMORY_VECT(MEMORY_VECT_DATA),
42153 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
42154 MISSION_ACK(MISSION_ACK_DATA),
42155 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
42156 MISSION_COUNT(MISSION_COUNT_DATA),
42157 MISSION_CURRENT(MISSION_CURRENT_DATA),
42158 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
42159 MISSION_ITEM(MISSION_ITEM_DATA),
42160 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
42161 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
42162 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
42163 MISSION_REQUEST(MISSION_REQUEST_DATA),
42164 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
42165 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
42166 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
42167 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
42168 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
42169 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
42170 MOUNT_CONFIGURE(MOUNT_CONFIGURE_DATA),
42171 MOUNT_CONTROL(MOUNT_CONTROL_DATA),
42172 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
42173 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
42174 MOUNT_STATUS(MOUNT_STATUS_DATA),
42175 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
42176 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
42177 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
42178 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
42179 OBSTACLE_DISTANCE_3D(OBSTACLE_DISTANCE_3D_DATA),
42180 ODOMETRY(ODOMETRY_DATA),
42181 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
42182 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
42183 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
42184 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
42185 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
42186 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
42187 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
42188 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
42189 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
42190 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
42191 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
42192 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
42193 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
42194 OSD_PARAM_CONFIG(OSD_PARAM_CONFIG_DATA),
42195 OSD_PARAM_CONFIG_REPLY(OSD_PARAM_CONFIG_REPLY_DATA),
42196 OSD_PARAM_SHOW_CONFIG(OSD_PARAM_SHOW_CONFIG_DATA),
42197 OSD_PARAM_SHOW_CONFIG_REPLY(OSD_PARAM_SHOW_CONFIG_REPLY_DATA),
42198 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
42199 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
42200 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
42201 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
42202 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
42203 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
42204 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
42205 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
42206 PARAM_SET(PARAM_SET_DATA),
42207 PARAM_VALUE(PARAM_VALUE_DATA),
42208 PID_TUNING(PID_TUNING_DATA),
42209 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
42210 PING(PING_DATA),
42211 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
42212 PLAY_TUNE(PLAY_TUNE_DATA),
42213 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
42214 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
42215 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
42216 POWER_STATUS(POWER_STATUS_DATA),
42217 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
42218 RADIO(RADIO_DATA),
42219 RADIO_STATUS(RADIO_STATUS_DATA),
42220 RALLY_FETCH_POINT(RALLY_FETCH_POINT_DATA),
42221 RALLY_POINT(RALLY_POINT_DATA),
42222 RANGEFINDER(RANGEFINDER_DATA),
42223 RAW_IMU(RAW_IMU_DATA),
42224 RAW_PRESSURE(RAW_PRESSURE_DATA),
42225 RAW_RPM(RAW_RPM_DATA),
42226 RC_CHANNELS(RC_CHANNELS_DATA),
42227 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
42228 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
42229 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
42230 REMOTE_LOG_BLOCK_STATUS(REMOTE_LOG_BLOCK_STATUS_DATA),
42231 REMOTE_LOG_DATA_BLOCK(REMOTE_LOG_DATA_BLOCK_DATA),
42232 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
42233 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
42234 REQUEST_EVENT(REQUEST_EVENT_DATA),
42235 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
42236 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
42237 RPM(RPM_DATA),
42238 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
42239 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
42240 SCALED_IMU(SCALED_IMU_DATA),
42241 SCALED_IMU2(SCALED_IMU2_DATA),
42242 SCALED_IMU3(SCALED_IMU3_DATA),
42243 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
42244 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
42245 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
42246 SECURE_COMMAND(SECURE_COMMAND_DATA),
42247 SECURE_COMMAND_REPLY(SECURE_COMMAND_REPLY_DATA),
42248 #[deprecated = " See `MAG_CAL_REPORT, Accel Parameters, and Gyro Parameters` (Deprecated since 2022-02)"]
42249 SENSOR_OFFSETS(SENSOR_OFFSETS_DATA),
42250 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
42251 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
42252 SETUP_SIGNING(SETUP_SIGNING_DATA),
42253 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
42254 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
42255 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
42256 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
42257 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
42258 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
42259 #[deprecated = " See `MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS` (Deprecated since 2014-07)"]
42260 SET_MAG_OFFSETS(SET_MAG_OFFSETS_DATA),
42261 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
42262 SET_MODE(SET_MODE_DATA),
42263 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
42264 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
42265 SIMSTATE(SIMSTATE_DATA),
42266 SIM_STATE(SIM_STATE_DATA),
42267 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
42268 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
42269 STATUSTEXT(STATUSTEXT_DATA),
42270 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
42271 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
42272 SYSTEM_TIME(SYSTEM_TIME_DATA),
42273 SYS_STATUS(SYS_STATUS_DATA),
42274 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
42275 TERRAIN_DATA(TERRAIN_DATA_DATA),
42276 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
42277 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
42278 TIMESYNC(TIMESYNC_DATA),
42279 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
42280 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
42281 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
42282 TUNNEL(TUNNEL_DATA),
42283 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
42284 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
42285 UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA),
42286 UAVIONIX_ADSB_OUT_CFG(UAVIONIX_ADSB_OUT_CFG_DATA),
42287 UAVIONIX_ADSB_OUT_CFG_FLIGHTID(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA),
42288 UAVIONIX_ADSB_OUT_CFG_REGISTRATION(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA),
42289 UAVIONIX_ADSB_OUT_CONTROL(UAVIONIX_ADSB_OUT_CONTROL_DATA),
42290 UAVIONIX_ADSB_OUT_DYNAMIC(UAVIONIX_ADSB_OUT_DYNAMIC_DATA),
42291 UAVIONIX_ADSB_OUT_STATUS(UAVIONIX_ADSB_OUT_STATUS_DATA),
42292 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA),
42293 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
42294 V2_EXTENSION(V2_EXTENSION_DATA),
42295 VFR_HUD(VFR_HUD_DATA),
42296 VIBRATION(VIBRATION_DATA),
42297 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
42298 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
42299 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
42300 VISION_POSITION_DELTA(VISION_POSITION_DELTA_DATA),
42301 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
42302 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
42303 WATER_DEPTH(WATER_DEPTH_DATA),
42304 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
42305 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
42306 WINCH_STATUS(WINCH_STATUS_DATA),
42307 WIND(WIND_DATA),
42308 WIND_COV(WIND_COV_DATA),
42309}
42310impl MavMessage {
42311 pub const fn all_ids() -> &'static [u32] {
42312 &[
42313 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
42314 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
42315 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
42316 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
42317 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
42318 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
42319 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
42320 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
42321 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
42322 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
42323 148u32, 149u32, 150u32, 151u32, 152u32, 153u32, 154u32, 155u32, 156u32, 157u32, 158u32,
42324 160u32, 161u32, 162u32, 163u32, 164u32, 165u32, 166u32, 167u32, 168u32, 169u32, 170u32,
42325 171u32, 172u32, 173u32, 174u32, 175u32, 176u32, 177u32, 178u32, 179u32, 180u32, 181u32,
42326 182u32, 183u32, 184u32, 185u32, 186u32, 191u32, 192u32, 193u32, 194u32, 195u32, 200u32,
42327 201u32, 214u32, 215u32, 216u32, 217u32, 218u32, 219u32, 225u32, 226u32, 230u32, 231u32,
42328 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32,
42329 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32,
42330 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32,
42331 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32,
42332 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32,
42333 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32,
42334 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32,
42335 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32,
42336 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 10001u32, 10002u32, 10003u32,
42337 10004u32, 10005u32, 10006u32, 10007u32, 10008u32, 10151u32, 11000u32, 11001u32,
42338 11002u32, 11003u32, 11004u32, 11005u32, 11010u32, 11011u32, 11020u32, 11030u32,
42339 11031u32, 11032u32, 11033u32, 11034u32, 11035u32, 11036u32, 11037u32, 11038u32,
42340 11039u32, 11040u32, 11041u32, 11042u32, 11043u32, 11044u32, 12900u32, 12901u32,
42341 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
42342 42000u32, 42001u32, 50001u32, 50002u32, 50003u32, 50004u32, 50005u32, 52000u32,
42343 52001u32,
42344 ]
42345 }
42346}
42347impl Message for MavMessage {
42348 fn parse(
42349 version: MavlinkVersion,
42350 id: u32,
42351 payload: &[u8],
42352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
42353 match id {
42354 ACTUATOR_CONTROL_TARGET_DATA::ID => {
42355 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
42356 .map(Self::ACTUATOR_CONTROL_TARGET)
42357 }
42358 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
42359 .map(Self::ACTUATOR_OUTPUT_STATUS),
42360 ADAP_TUNING_DATA::ID => {
42361 ADAP_TUNING_DATA::deser(version, payload).map(Self::ADAP_TUNING)
42362 }
42363 ADSB_VEHICLE_DATA::ID => {
42364 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
42365 }
42366 AHRS_DATA::ID => AHRS_DATA::deser(version, payload).map(Self::AHRS),
42367 AHRS2_DATA::ID => AHRS2_DATA::deser(version, payload).map(Self::AHRS2),
42368 AHRS3_DATA::ID => AHRS3_DATA::deser(version, payload).map(Self::AHRS3),
42369 AIRLINK_AUTH_DATA::ID => {
42370 AIRLINK_AUTH_DATA::deser(version, payload).map(Self::AIRLINK_AUTH)
42371 }
42372 AIRLINK_AUTH_RESPONSE_DATA::ID => {
42373 AIRLINK_AUTH_RESPONSE_DATA::deser(version, payload).map(Self::AIRLINK_AUTH_RESPONSE)
42374 }
42375 AIRSPEED_AUTOCAL_DATA::ID => {
42376 AIRSPEED_AUTOCAL_DATA::deser(version, payload).map(Self::AIRSPEED_AUTOCAL)
42377 }
42378 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
42379 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
42380 AOA_SSA_DATA::ID => AOA_SSA_DATA::deser(version, payload).map(Self::AOA_SSA),
42381 AP_ADC_DATA::ID => AP_ADC_DATA::deser(version, payload).map(Self::AP_ADC),
42382 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
42383 ATTITUDE_QUATERNION_DATA::ID => {
42384 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
42385 }
42386 ATTITUDE_QUATERNION_COV_DATA::ID => {
42387 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
42388 .map(Self::ATTITUDE_QUATERNION_COV)
42389 }
42390 ATTITUDE_TARGET_DATA::ID => {
42391 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
42392 }
42393 ATT_POS_MOCAP_DATA::ID => {
42394 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
42395 }
42396 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
42397 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
42398 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
42399 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
42400 }
42401 AUTOPILOT_VERSION_DATA::ID => {
42402 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
42403 }
42404 AUTOPILOT_VERSION_REQUEST_DATA::ID => {
42405 AUTOPILOT_VERSION_REQUEST_DATA::deser(version, payload)
42406 .map(Self::AUTOPILOT_VERSION_REQUEST)
42407 }
42408 AVAILABLE_MODES_DATA::ID => {
42409 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
42410 }
42411 AVAILABLE_MODES_MONITOR_DATA::ID => {
42412 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
42413 .map(Self::AVAILABLE_MODES_MONITOR)
42414 }
42415 BATTERY2_DATA::ID => BATTERY2_DATA::deser(version, payload).map(Self::BATTERY2),
42416 BATTERY_INFO_DATA::ID => {
42417 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
42418 }
42419 BATTERY_STATUS_DATA::ID => {
42420 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
42421 }
42422 BUTTON_CHANGE_DATA::ID => {
42423 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
42424 }
42425 CAMERA_CAPTURE_STATUS_DATA::ID => {
42426 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
42427 }
42428 CAMERA_FEEDBACK_DATA::ID => {
42429 CAMERA_FEEDBACK_DATA::deser(version, payload).map(Self::CAMERA_FEEDBACK)
42430 }
42431 CAMERA_FOV_STATUS_DATA::ID => {
42432 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
42433 }
42434 CAMERA_IMAGE_CAPTURED_DATA::ID => {
42435 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
42436 }
42437 CAMERA_INFORMATION_DATA::ID => {
42438 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
42439 }
42440 CAMERA_SETTINGS_DATA::ID => {
42441 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
42442 }
42443 CAMERA_STATUS_DATA::ID => {
42444 CAMERA_STATUS_DATA::deser(version, payload).map(Self::CAMERA_STATUS)
42445 }
42446 CAMERA_THERMAL_RANGE_DATA::ID => {
42447 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
42448 }
42449 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
42450 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
42451 .map(Self::CAMERA_TRACKING_GEO_STATUS)
42452 }
42453 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
42454 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
42455 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
42456 }
42457 CAMERA_TRIGGER_DATA::ID => {
42458 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
42459 }
42460 CANFD_FRAME_DATA::ID => {
42461 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
42462 }
42463 CAN_FILTER_MODIFY_DATA::ID => {
42464 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
42465 }
42466 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
42467 CELLULAR_CONFIG_DATA::ID => {
42468 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
42469 }
42470 CELLULAR_STATUS_DATA::ID => {
42471 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
42472 }
42473 CHANGE_OPERATOR_CONTROL_DATA::ID => {
42474 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
42475 .map(Self::CHANGE_OPERATOR_CONTROL)
42476 }
42477 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
42478 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
42479 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
42480 }
42481 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
42482 COMMAND_ACK_DATA::ID => {
42483 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
42484 }
42485 COMMAND_CANCEL_DATA::ID => {
42486 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
42487 }
42488 COMMAND_INT_DATA::ID => {
42489 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
42490 }
42491 COMMAND_LONG_DATA::ID => {
42492 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
42493 }
42494 COMPASSMOT_STATUS_DATA::ID => {
42495 COMPASSMOT_STATUS_DATA::deser(version, payload).map(Self::COMPASSMOT_STATUS)
42496 }
42497 COMPONENT_INFORMATION_DATA::ID => {
42498 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
42499 }
42500 COMPONENT_INFORMATION_BASIC_DATA::ID => {
42501 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
42502 .map(Self::COMPONENT_INFORMATION_BASIC)
42503 }
42504 COMPONENT_METADATA_DATA::ID => {
42505 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
42506 }
42507 CONTROL_SYSTEM_STATE_DATA::ID => {
42508 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
42509 }
42510 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
42511 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::deser(version, payload)
42512 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP)
42513 }
42514 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
42515 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::deser(version, payload)
42516 .map(Self::CUBEPILOT_FIRMWARE_UPDATE_START)
42517 }
42518 CUBEPILOT_RAW_RC_DATA::ID => {
42519 CUBEPILOT_RAW_RC_DATA::deser(version, payload).map(Self::CUBEPILOT_RAW_RC)
42520 }
42521 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
42522 .map(Self::CURRENT_EVENT_SEQUENCE),
42523 CURRENT_MODE_DATA::ID => {
42524 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
42525 }
42526 DATA16_DATA::ID => DATA16_DATA::deser(version, payload).map(Self::DATA16),
42527 DATA32_DATA::ID => DATA32_DATA::deser(version, payload).map(Self::DATA32),
42528 DATA64_DATA::ID => DATA64_DATA::deser(version, payload).map(Self::DATA64),
42529 DATA96_DATA::ID => DATA96_DATA::deser(version, payload).map(Self::DATA96),
42530 DATA_STREAM_DATA::ID => {
42531 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
42532 }
42533 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
42534 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
42535 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
42536 }
42537 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
42538 DEBUG_FLOAT_ARRAY_DATA::ID => {
42539 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
42540 }
42541 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
42542 DEEPSTALL_DATA::ID => DEEPSTALL_DATA::deser(version, payload).map(Self::DEEPSTALL),
42543 DEVICE_OP_READ_DATA::ID => {
42544 DEVICE_OP_READ_DATA::deser(version, payload).map(Self::DEVICE_OP_READ)
42545 }
42546 DEVICE_OP_READ_REPLY_DATA::ID => {
42547 DEVICE_OP_READ_REPLY_DATA::deser(version, payload).map(Self::DEVICE_OP_READ_REPLY)
42548 }
42549 DEVICE_OP_WRITE_DATA::ID => {
42550 DEVICE_OP_WRITE_DATA::deser(version, payload).map(Self::DEVICE_OP_WRITE)
42551 }
42552 DEVICE_OP_WRITE_REPLY_DATA::ID => {
42553 DEVICE_OP_WRITE_REPLY_DATA::deser(version, payload).map(Self::DEVICE_OP_WRITE_REPLY)
42554 }
42555 DIGICAM_CONFIGURE_DATA::ID => {
42556 DIGICAM_CONFIGURE_DATA::deser(version, payload).map(Self::DIGICAM_CONFIGURE)
42557 }
42558 DIGICAM_CONTROL_DATA::ID => {
42559 DIGICAM_CONTROL_DATA::deser(version, payload).map(Self::DIGICAM_CONTROL)
42560 }
42561 DISTANCE_SENSOR_DATA::ID => {
42562 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
42563 }
42564 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
42565 EKF_STATUS_REPORT_DATA::ID => {
42566 EKF_STATUS_REPORT_DATA::deser(version, payload).map(Self::EKF_STATUS_REPORT)
42567 }
42568 ENCAPSULATED_DATA_DATA::ID => {
42569 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
42570 }
42571 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
42572 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
42573 ESC_TELEMETRY_13_TO_16_DATA::ID => ESC_TELEMETRY_13_TO_16_DATA::deser(version, payload)
42574 .map(Self::ESC_TELEMETRY_13_TO_16),
42575 ESC_TELEMETRY_17_TO_20_DATA::ID => ESC_TELEMETRY_17_TO_20_DATA::deser(version, payload)
42576 .map(Self::ESC_TELEMETRY_17_TO_20),
42577 ESC_TELEMETRY_1_TO_4_DATA::ID => {
42578 ESC_TELEMETRY_1_TO_4_DATA::deser(version, payload).map(Self::ESC_TELEMETRY_1_TO_4)
42579 }
42580 ESC_TELEMETRY_21_TO_24_DATA::ID => ESC_TELEMETRY_21_TO_24_DATA::deser(version, payload)
42581 .map(Self::ESC_TELEMETRY_21_TO_24),
42582 ESC_TELEMETRY_25_TO_28_DATA::ID => ESC_TELEMETRY_25_TO_28_DATA::deser(version, payload)
42583 .map(Self::ESC_TELEMETRY_25_TO_28),
42584 ESC_TELEMETRY_29_TO_32_DATA::ID => ESC_TELEMETRY_29_TO_32_DATA::deser(version, payload)
42585 .map(Self::ESC_TELEMETRY_29_TO_32),
42586 ESC_TELEMETRY_5_TO_8_DATA::ID => {
42587 ESC_TELEMETRY_5_TO_8_DATA::deser(version, payload).map(Self::ESC_TELEMETRY_5_TO_8)
42588 }
42589 ESC_TELEMETRY_9_TO_12_DATA::ID => {
42590 ESC_TELEMETRY_9_TO_12_DATA::deser(version, payload).map(Self::ESC_TELEMETRY_9_TO_12)
42591 }
42592 ESTIMATOR_STATUS_DATA::ID => {
42593 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
42594 }
42595 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
42596 EXTENDED_SYS_STATE_DATA::ID => {
42597 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
42598 }
42599 FENCE_FETCH_POINT_DATA::ID => {
42600 FENCE_FETCH_POINT_DATA::deser(version, payload).map(Self::FENCE_FETCH_POINT)
42601 }
42602 FENCE_POINT_DATA::ID => {
42603 FENCE_POINT_DATA::deser(version, payload).map(Self::FENCE_POINT)
42604 }
42605 FENCE_STATUS_DATA::ID => {
42606 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
42607 }
42608 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
42609 .map(Self::FILE_TRANSFER_PROTOCOL),
42610 FLIGHT_INFORMATION_DATA::ID => {
42611 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
42612 }
42613 FOLLOW_TARGET_DATA::ID => {
42614 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
42615 }
42616 FUEL_STATUS_DATA::ID => {
42617 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
42618 }
42619 GENERATOR_STATUS_DATA::ID => {
42620 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
42621 }
42622 GIMBAL_CONTROL_DATA::ID => {
42623 GIMBAL_CONTROL_DATA::deser(version, payload).map(Self::GIMBAL_CONTROL)
42624 }
42625 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
42626 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
42627 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
42628 }
42629 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
42630 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
42631 .map(Self::GIMBAL_DEVICE_INFORMATION)
42632 }
42633 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
42634 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
42635 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
42636 }
42637 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
42638 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
42639 .map(Self::GIMBAL_MANAGER_INFORMATION)
42640 }
42641 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
42642 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
42643 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
42644 }
42645 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
42646 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
42647 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
42648 }
42649 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
42650 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
42651 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
42652 }
42653 GIMBAL_MANAGER_STATUS_DATA::ID => {
42654 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
42655 }
42656 GIMBAL_REPORT_DATA::ID => {
42657 GIMBAL_REPORT_DATA::deser(version, payload).map(Self::GIMBAL_REPORT)
42658 }
42659 GIMBAL_TORQUE_CMD_REPORT_DATA::ID => {
42660 GIMBAL_TORQUE_CMD_REPORT_DATA::deser(version, payload)
42661 .map(Self::GIMBAL_TORQUE_CMD_REPORT)
42662 }
42663 GLOBAL_POSITION_INT_DATA::ID => {
42664 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
42665 }
42666 GLOBAL_POSITION_INT_COV_DATA::ID => {
42667 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
42668 .map(Self::GLOBAL_POSITION_INT_COV)
42669 }
42670 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
42671 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
42672 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
42673 }
42674 GOPRO_GET_REQUEST_DATA::ID => {
42675 GOPRO_GET_REQUEST_DATA::deser(version, payload).map(Self::GOPRO_GET_REQUEST)
42676 }
42677 GOPRO_GET_RESPONSE_DATA::ID => {
42678 GOPRO_GET_RESPONSE_DATA::deser(version, payload).map(Self::GOPRO_GET_RESPONSE)
42679 }
42680 GOPRO_HEARTBEAT_DATA::ID => {
42681 GOPRO_HEARTBEAT_DATA::deser(version, payload).map(Self::GOPRO_HEARTBEAT)
42682 }
42683 GOPRO_SET_REQUEST_DATA::ID => {
42684 GOPRO_SET_REQUEST_DATA::deser(version, payload).map(Self::GOPRO_SET_REQUEST)
42685 }
42686 GOPRO_SET_RESPONSE_DATA::ID => {
42687 GOPRO_SET_RESPONSE_DATA::deser(version, payload).map(Self::GOPRO_SET_RESPONSE)
42688 }
42689 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
42690 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
42691 GPS_GLOBAL_ORIGIN_DATA::ID => {
42692 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
42693 }
42694 GPS_INJECT_DATA_DATA::ID => {
42695 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
42696 }
42697 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
42698 GPS_RAW_INT_DATA::ID => {
42699 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
42700 }
42701 GPS_RTCM_DATA_DATA::ID => {
42702 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
42703 }
42704 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
42705 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
42706 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
42707 HERELINK_TELEM_DATA::ID => {
42708 HERELINK_TELEM_DATA::deser(version, payload).map(Self::HERELINK_TELEM)
42709 }
42710 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
42711 HERELINK_VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
42712 .map(Self::HERELINK_VIDEO_STREAM_INFORMATION)
42713 }
42714 HIGHRES_IMU_DATA::ID => {
42715 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
42716 }
42717 HIGH_LATENCY_DATA::ID => {
42718 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
42719 }
42720 HIGH_LATENCY2_DATA::ID => {
42721 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
42722 }
42723 HIL_ACTUATOR_CONTROLS_DATA::ID => {
42724 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
42725 }
42726 HIL_CONTROLS_DATA::ID => {
42727 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
42728 }
42729 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
42730 HIL_OPTICAL_FLOW_DATA::ID => {
42731 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
42732 }
42733 HIL_RC_INPUTS_RAW_DATA::ID => {
42734 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
42735 }
42736 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
42737 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
42738 HIL_STATE_QUATERNION_DATA::ID => {
42739 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
42740 }
42741 HOME_POSITION_DATA::ID => {
42742 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
42743 }
42744 HWSTATUS_DATA::ID => HWSTATUS_DATA::deser(version, payload).map(Self::HWSTATUS),
42745 HYGROMETER_SENSOR_DATA::ID => {
42746 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
42747 }
42748 ICAROUS_HEARTBEAT_DATA::ID => {
42749 ICAROUS_HEARTBEAT_DATA::deser(version, payload).map(Self::ICAROUS_HEARTBEAT)
42750 }
42751 ICAROUS_KINEMATIC_BANDS_DATA::ID => {
42752 ICAROUS_KINEMATIC_BANDS_DATA::deser(version, payload)
42753 .map(Self::ICAROUS_KINEMATIC_BANDS)
42754 }
42755 ILLUMINATOR_STATUS_DATA::ID => {
42756 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
42757 }
42758 ISBD_LINK_STATUS_DATA::ID => {
42759 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
42760 }
42761 LANDING_TARGET_DATA::ID => {
42762 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
42763 }
42764 LED_CONTROL_DATA::ID => {
42765 LED_CONTROL_DATA::deser(version, payload).map(Self::LED_CONTROL)
42766 }
42767 LIMITS_STATUS_DATA::ID => {
42768 LIMITS_STATUS_DATA::deser(version, payload).map(Self::LIMITS_STATUS)
42769 }
42770 LINK_NODE_STATUS_DATA::ID => {
42771 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
42772 }
42773 LOCAL_POSITION_NED_DATA::ID => {
42774 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
42775 }
42776 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
42777 .map(Self::LOCAL_POSITION_NED_COV),
42778 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
42779 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
42780 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
42781 }
42782 LOGGING_ACK_DATA::ID => {
42783 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
42784 }
42785 LOGGING_DATA_DATA::ID => {
42786 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
42787 }
42788 LOGGING_DATA_ACKED_DATA::ID => {
42789 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
42790 }
42791 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
42792 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
42793 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
42794 LOG_REQUEST_DATA_DATA::ID => {
42795 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
42796 }
42797 LOG_REQUEST_END_DATA::ID => {
42798 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
42799 }
42800 LOG_REQUEST_LIST_DATA::ID => {
42801 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
42802 }
42803 LOWEHEISER_GOV_EFI_DATA::ID => {
42804 LOWEHEISER_GOV_EFI_DATA::deser(version, payload).map(Self::LOWEHEISER_GOV_EFI)
42805 }
42806 MAG_CAL_PROGRESS_DATA::ID => {
42807 MAG_CAL_PROGRESS_DATA::deser(version, payload).map(Self::MAG_CAL_PROGRESS)
42808 }
42809 MAG_CAL_REPORT_DATA::ID => {
42810 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
42811 }
42812 MANUAL_CONTROL_DATA::ID => {
42813 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
42814 }
42815 MANUAL_SETPOINT_DATA::ID => {
42816 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
42817 }
42818 MCU_STATUS_DATA::ID => MCU_STATUS_DATA::deser(version, payload).map(Self::MCU_STATUS),
42819 MEMINFO_DATA::ID => MEMINFO_DATA::deser(version, payload).map(Self::MEMINFO),
42820 MEMORY_VECT_DATA::ID => {
42821 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
42822 }
42823 MESSAGE_INTERVAL_DATA::ID => {
42824 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
42825 }
42826 MISSION_ACK_DATA::ID => {
42827 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
42828 }
42829 MISSION_CLEAR_ALL_DATA::ID => {
42830 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
42831 }
42832 MISSION_COUNT_DATA::ID => {
42833 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
42834 }
42835 MISSION_CURRENT_DATA::ID => {
42836 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
42837 }
42838 MISSION_ITEM_DATA::ID => {
42839 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
42840 }
42841 MISSION_ITEM_INT_DATA::ID => {
42842 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
42843 }
42844 MISSION_ITEM_REACHED_DATA::ID => {
42845 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
42846 }
42847 MISSION_REQUEST_DATA::ID => {
42848 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
42849 }
42850 MISSION_REQUEST_INT_DATA::ID => {
42851 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
42852 }
42853 MISSION_REQUEST_LIST_DATA::ID => {
42854 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
42855 }
42856 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
42857 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
42858 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
42859 }
42860 MISSION_SET_CURRENT_DATA::ID => {
42861 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
42862 }
42863 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
42864 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
42865 .map(Self::MISSION_WRITE_PARTIAL_LIST)
42866 }
42867 MOUNT_CONFIGURE_DATA::ID => {
42868 MOUNT_CONFIGURE_DATA::deser(version, payload).map(Self::MOUNT_CONFIGURE)
42869 }
42870 MOUNT_CONTROL_DATA::ID => {
42871 MOUNT_CONTROL_DATA::deser(version, payload).map(Self::MOUNT_CONTROL)
42872 }
42873 MOUNT_ORIENTATION_DATA::ID => {
42874 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
42875 }
42876 MOUNT_STATUS_DATA::ID => {
42877 MOUNT_STATUS_DATA::deser(version, payload).map(Self::MOUNT_STATUS)
42878 }
42879 NAMED_VALUE_FLOAT_DATA::ID => {
42880 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
42881 }
42882 NAMED_VALUE_INT_DATA::ID => {
42883 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
42884 }
42885 NAV_CONTROLLER_OUTPUT_DATA::ID => {
42886 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
42887 }
42888 OBSTACLE_DISTANCE_DATA::ID => {
42889 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
42890 }
42891 OBSTACLE_DISTANCE_3D_DATA::ID => {
42892 OBSTACLE_DISTANCE_3D_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE_3D)
42893 }
42894 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
42895 ONBOARD_COMPUTER_STATUS_DATA::ID => {
42896 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
42897 .map(Self::ONBOARD_COMPUTER_STATUS)
42898 }
42899 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
42900 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
42901 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
42902 }
42903 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
42904 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
42905 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
42906 }
42907 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
42908 .map(Self::OPEN_DRONE_ID_BASIC_ID),
42909 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
42910 .map(Self::OPEN_DRONE_ID_LOCATION),
42911 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
42912 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
42913 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
42914 }
42915 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
42916 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
42917 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
42918 }
42919 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
42920 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
42921 }
42922 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
42923 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
42924 }
42925 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
42926 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
42927 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
42928 }
42929 OPTICAL_FLOW_DATA::ID => {
42930 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
42931 }
42932 OPTICAL_FLOW_RAD_DATA::ID => {
42933 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
42934 }
42935 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
42936 .map(Self::ORBIT_EXECUTION_STATUS),
42937 OSD_PARAM_CONFIG_DATA::ID => {
42938 OSD_PARAM_CONFIG_DATA::deser(version, payload).map(Self::OSD_PARAM_CONFIG)
42939 }
42940 OSD_PARAM_CONFIG_REPLY_DATA::ID => OSD_PARAM_CONFIG_REPLY_DATA::deser(version, payload)
42941 .map(Self::OSD_PARAM_CONFIG_REPLY),
42942 OSD_PARAM_SHOW_CONFIG_DATA::ID => {
42943 OSD_PARAM_SHOW_CONFIG_DATA::deser(version, payload).map(Self::OSD_PARAM_SHOW_CONFIG)
42944 }
42945 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID => {
42946 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::deser(version, payload)
42947 .map(Self::OSD_PARAM_SHOW_CONFIG_REPLY)
42948 }
42949 PARAM_EXT_ACK_DATA::ID => {
42950 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
42951 }
42952 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
42953 .map(Self::PARAM_EXT_REQUEST_LIST),
42954 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
42955 .map(Self::PARAM_EXT_REQUEST_READ),
42956 PARAM_EXT_SET_DATA::ID => {
42957 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
42958 }
42959 PARAM_EXT_VALUE_DATA::ID => {
42960 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
42961 }
42962 PARAM_MAP_RC_DATA::ID => {
42963 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
42964 }
42965 PARAM_REQUEST_LIST_DATA::ID => {
42966 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
42967 }
42968 PARAM_REQUEST_READ_DATA::ID => {
42969 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
42970 }
42971 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
42972 PARAM_VALUE_DATA::ID => {
42973 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
42974 }
42975 PID_TUNING_DATA::ID => PID_TUNING_DATA::deser(version, payload).map(Self::PID_TUNING),
42976 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
42977 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
42978 PLAY_TUNE_V2_DATA::ID => {
42979 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
42980 }
42981 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
42982 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
42983 .map(Self::POSITION_TARGET_GLOBAL_INT)
42984 }
42985 POSITION_TARGET_LOCAL_NED_DATA::ID => {
42986 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
42987 .map(Self::POSITION_TARGET_LOCAL_NED)
42988 }
42989 POWER_STATUS_DATA::ID => {
42990 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
42991 }
42992 PROTOCOL_VERSION_DATA::ID => {
42993 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
42994 }
42995 RADIO_DATA::ID => RADIO_DATA::deser(version, payload).map(Self::RADIO),
42996 RADIO_STATUS_DATA::ID => {
42997 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
42998 }
42999 RALLY_FETCH_POINT_DATA::ID => {
43000 RALLY_FETCH_POINT_DATA::deser(version, payload).map(Self::RALLY_FETCH_POINT)
43001 }
43002 RALLY_POINT_DATA::ID => {
43003 RALLY_POINT_DATA::deser(version, payload).map(Self::RALLY_POINT)
43004 }
43005 RANGEFINDER_DATA::ID => {
43006 RANGEFINDER_DATA::deser(version, payload).map(Self::RANGEFINDER)
43007 }
43008 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
43009 RAW_PRESSURE_DATA::ID => {
43010 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
43011 }
43012 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
43013 RC_CHANNELS_DATA::ID => {
43014 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
43015 }
43016 RC_CHANNELS_OVERRIDE_DATA::ID => {
43017 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
43018 }
43019 RC_CHANNELS_RAW_DATA::ID => {
43020 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
43021 }
43022 RC_CHANNELS_SCALED_DATA::ID => {
43023 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
43024 }
43025 REMOTE_LOG_BLOCK_STATUS_DATA::ID => {
43026 REMOTE_LOG_BLOCK_STATUS_DATA::deser(version, payload)
43027 .map(Self::REMOTE_LOG_BLOCK_STATUS)
43028 }
43029 REMOTE_LOG_DATA_BLOCK_DATA::ID => {
43030 REMOTE_LOG_DATA_BLOCK_DATA::deser(version, payload).map(Self::REMOTE_LOG_DATA_BLOCK)
43031 }
43032 REQUEST_DATA_STREAM_DATA::ID => {
43033 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
43034 }
43035 REQUEST_EVENT_DATA::ID => {
43036 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
43037 }
43038 RESOURCE_REQUEST_DATA::ID => {
43039 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
43040 }
43041 RESPONSE_EVENT_ERROR_DATA::ID => {
43042 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
43043 }
43044 RPM_DATA::ID => RPM_DATA::deser(version, payload).map(Self::RPM),
43045 SAFETY_ALLOWED_AREA_DATA::ID => {
43046 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
43047 }
43048 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
43049 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
43050 .map(Self::SAFETY_SET_ALLOWED_AREA)
43051 }
43052 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
43053 SCALED_IMU2_DATA::ID => {
43054 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
43055 }
43056 SCALED_IMU3_DATA::ID => {
43057 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
43058 }
43059 SCALED_PRESSURE_DATA::ID => {
43060 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
43061 }
43062 SCALED_PRESSURE2_DATA::ID => {
43063 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
43064 }
43065 SCALED_PRESSURE3_DATA::ID => {
43066 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
43067 }
43068 SECURE_COMMAND_DATA::ID => {
43069 SECURE_COMMAND_DATA::deser(version, payload).map(Self::SECURE_COMMAND)
43070 }
43071 SECURE_COMMAND_REPLY_DATA::ID => {
43072 SECURE_COMMAND_REPLY_DATA::deser(version, payload).map(Self::SECURE_COMMAND_REPLY)
43073 }
43074 SENSOR_OFFSETS_DATA::ID => {
43075 SENSOR_OFFSETS_DATA::deser(version, payload).map(Self::SENSOR_OFFSETS)
43076 }
43077 SERIAL_CONTROL_DATA::ID => {
43078 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
43079 }
43080 SERVO_OUTPUT_RAW_DATA::ID => {
43081 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
43082 }
43083 SETUP_SIGNING_DATA::ID => {
43084 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
43085 }
43086 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
43087 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
43088 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
43089 }
43090 SET_ATTITUDE_TARGET_DATA::ID => {
43091 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
43092 }
43093 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
43094 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
43095 }
43096 SET_HOME_POSITION_DATA::ID => {
43097 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
43098 }
43099 SET_MAG_OFFSETS_DATA::ID => {
43100 SET_MAG_OFFSETS_DATA::deser(version, payload).map(Self::SET_MAG_OFFSETS)
43101 }
43102 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
43103 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
43104 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
43105 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
43106 }
43107 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
43108 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
43109 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
43110 }
43111 SIMSTATE_DATA::ID => SIMSTATE_DATA::deser(version, payload).map(Self::SIMSTATE),
43112 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
43113 SMART_BATTERY_INFO_DATA::ID => {
43114 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
43115 }
43116 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
43117 STORAGE_INFORMATION_DATA::ID => {
43118 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
43119 }
43120 SUPPORTED_TUNES_DATA::ID => {
43121 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
43122 }
43123 SYSTEM_TIME_DATA::ID => {
43124 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
43125 }
43126 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
43127 TERRAIN_CHECK_DATA::ID => {
43128 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
43129 }
43130 TERRAIN_DATA_DATA::ID => {
43131 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
43132 }
43133 TERRAIN_REPORT_DATA::ID => {
43134 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
43135 }
43136 TERRAIN_REQUEST_DATA::ID => {
43137 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
43138 }
43139 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
43140 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
43141 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
43142 .map(Self::TIME_ESTIMATE_TO_TARGET)
43143 }
43144 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
43145 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
43146 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
43147 }
43148 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
43149 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
43150 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
43151 }
43152 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
43153 UAVCAN_NODE_INFO_DATA::ID => {
43154 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
43155 }
43156 UAVCAN_NODE_STATUS_DATA::ID => {
43157 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
43158 }
43159 UAVIONIX_ADSB_GET_DATA::ID => {
43160 UAVIONIX_ADSB_GET_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_GET)
43161 }
43162 UAVIONIX_ADSB_OUT_CFG_DATA::ID => {
43163 UAVIONIX_ADSB_OUT_CFG_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_OUT_CFG)
43164 }
43165 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
43166 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::deser(version, payload)
43167 .map(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID)
43168 }
43169 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
43170 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::deser(version, payload)
43171 .map(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION)
43172 }
43173 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => {
43174 UAVIONIX_ADSB_OUT_CONTROL_DATA::deser(version, payload)
43175 .map(Self::UAVIONIX_ADSB_OUT_CONTROL)
43176 }
43177 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => {
43178 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::deser(version, payload)
43179 .map(Self::UAVIONIX_ADSB_OUT_DYNAMIC)
43180 }
43181 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => {
43182 UAVIONIX_ADSB_OUT_STATUS_DATA::deser(version, payload)
43183 .map(Self::UAVIONIX_ADSB_OUT_STATUS)
43184 }
43185 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
43186 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::deser(version, payload)
43187 .map(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT)
43188 }
43189 UTM_GLOBAL_POSITION_DATA::ID => {
43190 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
43191 }
43192 V2_EXTENSION_DATA::ID => {
43193 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
43194 }
43195 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
43196 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
43197 VICON_POSITION_ESTIMATE_DATA::ID => {
43198 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
43199 .map(Self::VICON_POSITION_ESTIMATE)
43200 }
43201 VIDEO_STREAM_INFORMATION_DATA::ID => {
43202 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
43203 .map(Self::VIDEO_STREAM_INFORMATION)
43204 }
43205 VIDEO_STREAM_STATUS_DATA::ID => {
43206 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
43207 }
43208 VISION_POSITION_DELTA_DATA::ID => {
43209 VISION_POSITION_DELTA_DATA::deser(version, payload).map(Self::VISION_POSITION_DELTA)
43210 }
43211 VISION_POSITION_ESTIMATE_DATA::ID => {
43212 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
43213 .map(Self::VISION_POSITION_ESTIMATE)
43214 }
43215 VISION_SPEED_ESTIMATE_DATA::ID => {
43216 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
43217 }
43218 WATER_DEPTH_DATA::ID => {
43219 WATER_DEPTH_DATA::deser(version, payload).map(Self::WATER_DEPTH)
43220 }
43221 WHEEL_DISTANCE_DATA::ID => {
43222 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
43223 }
43224 WIFI_CONFIG_AP_DATA::ID => {
43225 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
43226 }
43227 WINCH_STATUS_DATA::ID => {
43228 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
43229 }
43230 WIND_DATA::ID => WIND_DATA::deser(version, payload).map(Self::WIND),
43231 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
43232 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
43233 }
43234 }
43235 fn message_name(&self) -> &'static str {
43236 match self {
43237 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
43238 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
43239 Self::ADAP_TUNING(..) => ADAP_TUNING_DATA::NAME,
43240 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
43241 Self::AHRS(..) => AHRS_DATA::NAME,
43242 Self::AHRS2(..) => AHRS2_DATA::NAME,
43243 Self::AHRS3(..) => AHRS3_DATA::NAME,
43244 Self::AIRLINK_AUTH(..) => AIRLINK_AUTH_DATA::NAME,
43245 Self::AIRLINK_AUTH_RESPONSE(..) => AIRLINK_AUTH_RESPONSE_DATA::NAME,
43246 Self::AIRSPEED_AUTOCAL(..) => AIRSPEED_AUTOCAL_DATA::NAME,
43247 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
43248 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
43249 Self::AOA_SSA(..) => AOA_SSA_DATA::NAME,
43250 Self::AP_ADC(..) => AP_ADC_DATA::NAME,
43251 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
43252 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
43253 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
43254 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
43255 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
43256 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
43257 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
43258 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
43259 }
43260 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
43261 Self::AUTOPILOT_VERSION_REQUEST(..) => AUTOPILOT_VERSION_REQUEST_DATA::NAME,
43262 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
43263 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
43264 Self::BATTERY2(..) => BATTERY2_DATA::NAME,
43265 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
43266 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
43267 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
43268 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
43269 Self::CAMERA_FEEDBACK(..) => CAMERA_FEEDBACK_DATA::NAME,
43270 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
43271 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
43272 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
43273 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
43274 Self::CAMERA_STATUS(..) => CAMERA_STATUS_DATA::NAME,
43275 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
43276 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
43277 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
43278 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
43279 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
43280 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
43281 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
43282 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
43283 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
43284 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
43285 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
43286 Self::COLLISION(..) => COLLISION_DATA::NAME,
43287 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
43288 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
43289 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
43290 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
43291 Self::COMPASSMOT_STATUS(..) => COMPASSMOT_STATUS_DATA::NAME,
43292 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
43293 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
43294 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
43295 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
43296 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME,
43297 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME,
43298 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::NAME,
43299 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
43300 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
43301 Self::DATA16(..) => DATA16_DATA::NAME,
43302 Self::DATA32(..) => DATA32_DATA::NAME,
43303 Self::DATA64(..) => DATA64_DATA::NAME,
43304 Self::DATA96(..) => DATA96_DATA::NAME,
43305 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
43306 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
43307 Self::DEBUG(..) => DEBUG_DATA::NAME,
43308 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
43309 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
43310 Self::DEEPSTALL(..) => DEEPSTALL_DATA::NAME,
43311 Self::DEVICE_OP_READ(..) => DEVICE_OP_READ_DATA::NAME,
43312 Self::DEVICE_OP_READ_REPLY(..) => DEVICE_OP_READ_REPLY_DATA::NAME,
43313 Self::DEVICE_OP_WRITE(..) => DEVICE_OP_WRITE_DATA::NAME,
43314 Self::DEVICE_OP_WRITE_REPLY(..) => DEVICE_OP_WRITE_REPLY_DATA::NAME,
43315 Self::DIGICAM_CONFIGURE(..) => DIGICAM_CONFIGURE_DATA::NAME,
43316 Self::DIGICAM_CONTROL(..) => DIGICAM_CONTROL_DATA::NAME,
43317 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
43318 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
43319 Self::EKF_STATUS_REPORT(..) => EKF_STATUS_REPORT_DATA::NAME,
43320 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
43321 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
43322 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
43323 Self::ESC_TELEMETRY_13_TO_16(..) => ESC_TELEMETRY_13_TO_16_DATA::NAME,
43324 Self::ESC_TELEMETRY_17_TO_20(..) => ESC_TELEMETRY_17_TO_20_DATA::NAME,
43325 Self::ESC_TELEMETRY_1_TO_4(..) => ESC_TELEMETRY_1_TO_4_DATA::NAME,
43326 Self::ESC_TELEMETRY_21_TO_24(..) => ESC_TELEMETRY_21_TO_24_DATA::NAME,
43327 Self::ESC_TELEMETRY_25_TO_28(..) => ESC_TELEMETRY_25_TO_28_DATA::NAME,
43328 Self::ESC_TELEMETRY_29_TO_32(..) => ESC_TELEMETRY_29_TO_32_DATA::NAME,
43329 Self::ESC_TELEMETRY_5_TO_8(..) => ESC_TELEMETRY_5_TO_8_DATA::NAME,
43330 Self::ESC_TELEMETRY_9_TO_12(..) => ESC_TELEMETRY_9_TO_12_DATA::NAME,
43331 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
43332 Self::EVENT(..) => EVENT_DATA::NAME,
43333 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
43334 Self::FENCE_FETCH_POINT(..) => FENCE_FETCH_POINT_DATA::NAME,
43335 Self::FENCE_POINT(..) => FENCE_POINT_DATA::NAME,
43336 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
43337 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
43338 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
43339 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
43340 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
43341 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
43342 Self::GIMBAL_CONTROL(..) => GIMBAL_CONTROL_DATA::NAME,
43343 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
43344 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
43345 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
43346 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
43347 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
43348 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
43349 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
43350 }
43351 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
43352 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
43353 Self::GIMBAL_REPORT(..) => GIMBAL_REPORT_DATA::NAME,
43354 Self::GIMBAL_TORQUE_CMD_REPORT(..) => GIMBAL_TORQUE_CMD_REPORT_DATA::NAME,
43355 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
43356 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
43357 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
43358 Self::GOPRO_GET_REQUEST(..) => GOPRO_GET_REQUEST_DATA::NAME,
43359 Self::GOPRO_GET_RESPONSE(..) => GOPRO_GET_RESPONSE_DATA::NAME,
43360 Self::GOPRO_HEARTBEAT(..) => GOPRO_HEARTBEAT_DATA::NAME,
43361 Self::GOPRO_SET_REQUEST(..) => GOPRO_SET_REQUEST_DATA::NAME,
43362 Self::GOPRO_SET_RESPONSE(..) => GOPRO_SET_RESPONSE_DATA::NAME,
43363 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
43364 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
43365 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
43366 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
43367 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
43368 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
43369 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
43370 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
43371 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
43372 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
43373 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::NAME,
43374 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
43375 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME
43376 }
43377 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
43378 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
43379 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
43380 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
43381 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
43382 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
43383 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
43384 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
43385 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
43386 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
43387 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
43388 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
43389 Self::HWSTATUS(..) => HWSTATUS_DATA::NAME,
43390 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
43391 Self::ICAROUS_HEARTBEAT(..) => ICAROUS_HEARTBEAT_DATA::NAME,
43392 Self::ICAROUS_KINEMATIC_BANDS(..) => ICAROUS_KINEMATIC_BANDS_DATA::NAME,
43393 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
43394 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
43395 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
43396 Self::LED_CONTROL(..) => LED_CONTROL_DATA::NAME,
43397 Self::LIMITS_STATUS(..) => LIMITS_STATUS_DATA::NAME,
43398 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
43399 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
43400 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
43401 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
43402 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
43403 }
43404 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
43405 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
43406 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
43407 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
43408 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
43409 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
43410 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
43411 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
43412 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
43413 Self::LOWEHEISER_GOV_EFI(..) => LOWEHEISER_GOV_EFI_DATA::NAME,
43414 Self::MAG_CAL_PROGRESS(..) => MAG_CAL_PROGRESS_DATA::NAME,
43415 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
43416 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
43417 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
43418 Self::MCU_STATUS(..) => MCU_STATUS_DATA::NAME,
43419 Self::MEMINFO(..) => MEMINFO_DATA::NAME,
43420 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
43421 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
43422 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
43423 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
43424 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
43425 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
43426 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
43427 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
43428 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
43429 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
43430 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
43431 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
43432 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
43433 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
43434 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
43435 Self::MOUNT_CONFIGURE(..) => MOUNT_CONFIGURE_DATA::NAME,
43436 Self::MOUNT_CONTROL(..) => MOUNT_CONTROL_DATA::NAME,
43437 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
43438 Self::MOUNT_STATUS(..) => MOUNT_STATUS_DATA::NAME,
43439 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
43440 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
43441 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
43442 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
43443 Self::OBSTACLE_DISTANCE_3D(..) => OBSTACLE_DISTANCE_3D_DATA::NAME,
43444 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
43445 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
43446 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
43447 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
43448 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
43449 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
43450 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
43451 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
43452 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
43453 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
43454 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
43455 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
43456 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
43457 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
43458 Self::OSD_PARAM_CONFIG(..) => OSD_PARAM_CONFIG_DATA::NAME,
43459 Self::OSD_PARAM_CONFIG_REPLY(..) => OSD_PARAM_CONFIG_REPLY_DATA::NAME,
43460 Self::OSD_PARAM_SHOW_CONFIG(..) => OSD_PARAM_SHOW_CONFIG_DATA::NAME,
43461 Self::OSD_PARAM_SHOW_CONFIG_REPLY(..) => OSD_PARAM_SHOW_CONFIG_REPLY_DATA::NAME,
43462 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
43463 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
43464 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
43465 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
43466 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
43467 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
43468 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
43469 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
43470 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
43471 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
43472 Self::PID_TUNING(..) => PID_TUNING_DATA::NAME,
43473 Self::PING(..) => PING_DATA::NAME,
43474 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
43475 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
43476 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
43477 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
43478 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
43479 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
43480 Self::RADIO(..) => RADIO_DATA::NAME,
43481 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
43482 Self::RALLY_FETCH_POINT(..) => RALLY_FETCH_POINT_DATA::NAME,
43483 Self::RALLY_POINT(..) => RALLY_POINT_DATA::NAME,
43484 Self::RANGEFINDER(..) => RANGEFINDER_DATA::NAME,
43485 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
43486 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
43487 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
43488 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
43489 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
43490 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
43491 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
43492 Self::REMOTE_LOG_BLOCK_STATUS(..) => REMOTE_LOG_BLOCK_STATUS_DATA::NAME,
43493 Self::REMOTE_LOG_DATA_BLOCK(..) => REMOTE_LOG_DATA_BLOCK_DATA::NAME,
43494 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
43495 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
43496 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
43497 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
43498 Self::RPM(..) => RPM_DATA::NAME,
43499 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
43500 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
43501 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
43502 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
43503 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
43504 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
43505 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
43506 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
43507 Self::SECURE_COMMAND(..) => SECURE_COMMAND_DATA::NAME,
43508 Self::SECURE_COMMAND_REPLY(..) => SECURE_COMMAND_REPLY_DATA::NAME,
43509 Self::SENSOR_OFFSETS(..) => SENSOR_OFFSETS_DATA::NAME,
43510 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
43511 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
43512 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
43513 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
43514 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
43515 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
43516 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
43517 Self::SET_MAG_OFFSETS(..) => SET_MAG_OFFSETS_DATA::NAME,
43518 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
43519 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
43520 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
43521 Self::SIMSTATE(..) => SIMSTATE_DATA::NAME,
43522 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
43523 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
43524 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
43525 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
43526 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
43527 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
43528 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
43529 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
43530 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
43531 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
43532 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
43533 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
43534 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
43535 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
43536 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
43537 }
43538 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
43539 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
43540 }
43541 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
43542 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
43543 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
43544 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::NAME,
43545 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::NAME,
43546 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME,
43547 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
43548 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME
43549 }
43550 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME,
43551 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME,
43552 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::NAME,
43553 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
43554 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME
43555 }
43556 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
43557 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
43558 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
43559 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
43560 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
43561 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
43562 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
43563 Self::VISION_POSITION_DELTA(..) => VISION_POSITION_DELTA_DATA::NAME,
43564 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
43565 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
43566 Self::WATER_DEPTH(..) => WATER_DEPTH_DATA::NAME,
43567 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
43568 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
43569 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
43570 Self::WIND(..) => WIND_DATA::NAME,
43571 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
43572 }
43573 }
43574 fn message_id(&self) -> u32 {
43575 match self {
43576 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
43577 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
43578 Self::ADAP_TUNING(..) => ADAP_TUNING_DATA::ID,
43579 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
43580 Self::AHRS(..) => AHRS_DATA::ID,
43581 Self::AHRS2(..) => AHRS2_DATA::ID,
43582 Self::AHRS3(..) => AHRS3_DATA::ID,
43583 Self::AIRLINK_AUTH(..) => AIRLINK_AUTH_DATA::ID,
43584 Self::AIRLINK_AUTH_RESPONSE(..) => AIRLINK_AUTH_RESPONSE_DATA::ID,
43585 Self::AIRSPEED_AUTOCAL(..) => AIRSPEED_AUTOCAL_DATA::ID,
43586 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
43587 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
43588 Self::AOA_SSA(..) => AOA_SSA_DATA::ID,
43589 Self::AP_ADC(..) => AP_ADC_DATA::ID,
43590 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
43591 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
43592 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
43593 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
43594 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
43595 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
43596 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
43597 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
43598 }
43599 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
43600 Self::AUTOPILOT_VERSION_REQUEST(..) => AUTOPILOT_VERSION_REQUEST_DATA::ID,
43601 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
43602 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
43603 Self::BATTERY2(..) => BATTERY2_DATA::ID,
43604 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
43605 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
43606 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
43607 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
43608 Self::CAMERA_FEEDBACK(..) => CAMERA_FEEDBACK_DATA::ID,
43609 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
43610 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
43611 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
43612 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
43613 Self::CAMERA_STATUS(..) => CAMERA_STATUS_DATA::ID,
43614 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
43615 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
43616 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
43617 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
43618 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
43619 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
43620 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
43621 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
43622 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
43623 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
43624 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
43625 Self::COLLISION(..) => COLLISION_DATA::ID,
43626 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
43627 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
43628 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
43629 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
43630 Self::COMPASSMOT_STATUS(..) => COMPASSMOT_STATUS_DATA::ID,
43631 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
43632 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
43633 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
43634 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
43635 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(..) => CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID,
43636 Self::CUBEPILOT_FIRMWARE_UPDATE_START(..) => CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID,
43637 Self::CUBEPILOT_RAW_RC(..) => CUBEPILOT_RAW_RC_DATA::ID,
43638 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
43639 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
43640 Self::DATA16(..) => DATA16_DATA::ID,
43641 Self::DATA32(..) => DATA32_DATA::ID,
43642 Self::DATA64(..) => DATA64_DATA::ID,
43643 Self::DATA96(..) => DATA96_DATA::ID,
43644 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
43645 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
43646 Self::DEBUG(..) => DEBUG_DATA::ID,
43647 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
43648 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
43649 Self::DEEPSTALL(..) => DEEPSTALL_DATA::ID,
43650 Self::DEVICE_OP_READ(..) => DEVICE_OP_READ_DATA::ID,
43651 Self::DEVICE_OP_READ_REPLY(..) => DEVICE_OP_READ_REPLY_DATA::ID,
43652 Self::DEVICE_OP_WRITE(..) => DEVICE_OP_WRITE_DATA::ID,
43653 Self::DEVICE_OP_WRITE_REPLY(..) => DEVICE_OP_WRITE_REPLY_DATA::ID,
43654 Self::DIGICAM_CONFIGURE(..) => DIGICAM_CONFIGURE_DATA::ID,
43655 Self::DIGICAM_CONTROL(..) => DIGICAM_CONTROL_DATA::ID,
43656 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
43657 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
43658 Self::EKF_STATUS_REPORT(..) => EKF_STATUS_REPORT_DATA::ID,
43659 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
43660 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
43661 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
43662 Self::ESC_TELEMETRY_13_TO_16(..) => ESC_TELEMETRY_13_TO_16_DATA::ID,
43663 Self::ESC_TELEMETRY_17_TO_20(..) => ESC_TELEMETRY_17_TO_20_DATA::ID,
43664 Self::ESC_TELEMETRY_1_TO_4(..) => ESC_TELEMETRY_1_TO_4_DATA::ID,
43665 Self::ESC_TELEMETRY_21_TO_24(..) => ESC_TELEMETRY_21_TO_24_DATA::ID,
43666 Self::ESC_TELEMETRY_25_TO_28(..) => ESC_TELEMETRY_25_TO_28_DATA::ID,
43667 Self::ESC_TELEMETRY_29_TO_32(..) => ESC_TELEMETRY_29_TO_32_DATA::ID,
43668 Self::ESC_TELEMETRY_5_TO_8(..) => ESC_TELEMETRY_5_TO_8_DATA::ID,
43669 Self::ESC_TELEMETRY_9_TO_12(..) => ESC_TELEMETRY_9_TO_12_DATA::ID,
43670 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
43671 Self::EVENT(..) => EVENT_DATA::ID,
43672 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
43673 Self::FENCE_FETCH_POINT(..) => FENCE_FETCH_POINT_DATA::ID,
43674 Self::FENCE_POINT(..) => FENCE_POINT_DATA::ID,
43675 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
43676 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
43677 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
43678 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
43679 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
43680 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
43681 Self::GIMBAL_CONTROL(..) => GIMBAL_CONTROL_DATA::ID,
43682 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
43683 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
43684 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
43685 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
43686 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
43687 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
43688 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
43689 }
43690 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
43691 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
43692 Self::GIMBAL_REPORT(..) => GIMBAL_REPORT_DATA::ID,
43693 Self::GIMBAL_TORQUE_CMD_REPORT(..) => GIMBAL_TORQUE_CMD_REPORT_DATA::ID,
43694 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
43695 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
43696 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
43697 Self::GOPRO_GET_REQUEST(..) => GOPRO_GET_REQUEST_DATA::ID,
43698 Self::GOPRO_GET_RESPONSE(..) => GOPRO_GET_RESPONSE_DATA::ID,
43699 Self::GOPRO_HEARTBEAT(..) => GOPRO_HEARTBEAT_DATA::ID,
43700 Self::GOPRO_SET_REQUEST(..) => GOPRO_SET_REQUEST_DATA::ID,
43701 Self::GOPRO_SET_RESPONSE(..) => GOPRO_SET_RESPONSE_DATA::ID,
43702 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
43703 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
43704 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
43705 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
43706 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
43707 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
43708 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
43709 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
43710 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
43711 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
43712 Self::HERELINK_TELEM(..) => HERELINK_TELEM_DATA::ID,
43713 Self::HERELINK_VIDEO_STREAM_INFORMATION(..) => {
43714 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID
43715 }
43716 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
43717 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
43718 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
43719 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
43720 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
43721 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
43722 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
43723 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
43724 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
43725 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
43726 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
43727 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
43728 Self::HWSTATUS(..) => HWSTATUS_DATA::ID,
43729 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
43730 Self::ICAROUS_HEARTBEAT(..) => ICAROUS_HEARTBEAT_DATA::ID,
43731 Self::ICAROUS_KINEMATIC_BANDS(..) => ICAROUS_KINEMATIC_BANDS_DATA::ID,
43732 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
43733 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
43734 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
43735 Self::LED_CONTROL(..) => LED_CONTROL_DATA::ID,
43736 Self::LIMITS_STATUS(..) => LIMITS_STATUS_DATA::ID,
43737 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
43738 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
43739 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
43740 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
43741 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
43742 }
43743 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
43744 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
43745 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
43746 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
43747 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
43748 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
43749 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
43750 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
43751 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
43752 Self::LOWEHEISER_GOV_EFI(..) => LOWEHEISER_GOV_EFI_DATA::ID,
43753 Self::MAG_CAL_PROGRESS(..) => MAG_CAL_PROGRESS_DATA::ID,
43754 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
43755 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
43756 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
43757 Self::MCU_STATUS(..) => MCU_STATUS_DATA::ID,
43758 Self::MEMINFO(..) => MEMINFO_DATA::ID,
43759 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
43760 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
43761 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
43762 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
43763 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
43764 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
43765 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
43766 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
43767 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
43768 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
43769 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
43770 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
43771 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
43772 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
43773 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
43774 Self::MOUNT_CONFIGURE(..) => MOUNT_CONFIGURE_DATA::ID,
43775 Self::MOUNT_CONTROL(..) => MOUNT_CONTROL_DATA::ID,
43776 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
43777 Self::MOUNT_STATUS(..) => MOUNT_STATUS_DATA::ID,
43778 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
43779 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
43780 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
43781 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
43782 Self::OBSTACLE_DISTANCE_3D(..) => OBSTACLE_DISTANCE_3D_DATA::ID,
43783 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
43784 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
43785 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
43786 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
43787 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
43788 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
43789 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
43790 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
43791 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
43792 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
43793 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
43794 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
43795 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
43796 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
43797 Self::OSD_PARAM_CONFIG(..) => OSD_PARAM_CONFIG_DATA::ID,
43798 Self::OSD_PARAM_CONFIG_REPLY(..) => OSD_PARAM_CONFIG_REPLY_DATA::ID,
43799 Self::OSD_PARAM_SHOW_CONFIG(..) => OSD_PARAM_SHOW_CONFIG_DATA::ID,
43800 Self::OSD_PARAM_SHOW_CONFIG_REPLY(..) => OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID,
43801 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
43802 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
43803 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
43804 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
43805 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
43806 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
43807 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
43808 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
43809 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
43810 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
43811 Self::PID_TUNING(..) => PID_TUNING_DATA::ID,
43812 Self::PING(..) => PING_DATA::ID,
43813 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
43814 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
43815 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
43816 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
43817 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
43818 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
43819 Self::RADIO(..) => RADIO_DATA::ID,
43820 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
43821 Self::RALLY_FETCH_POINT(..) => RALLY_FETCH_POINT_DATA::ID,
43822 Self::RALLY_POINT(..) => RALLY_POINT_DATA::ID,
43823 Self::RANGEFINDER(..) => RANGEFINDER_DATA::ID,
43824 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
43825 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
43826 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
43827 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
43828 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
43829 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
43830 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
43831 Self::REMOTE_LOG_BLOCK_STATUS(..) => REMOTE_LOG_BLOCK_STATUS_DATA::ID,
43832 Self::REMOTE_LOG_DATA_BLOCK(..) => REMOTE_LOG_DATA_BLOCK_DATA::ID,
43833 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
43834 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
43835 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
43836 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
43837 Self::RPM(..) => RPM_DATA::ID,
43838 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
43839 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
43840 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
43841 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
43842 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
43843 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
43844 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
43845 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
43846 Self::SECURE_COMMAND(..) => SECURE_COMMAND_DATA::ID,
43847 Self::SECURE_COMMAND_REPLY(..) => SECURE_COMMAND_REPLY_DATA::ID,
43848 Self::SENSOR_OFFSETS(..) => SENSOR_OFFSETS_DATA::ID,
43849 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
43850 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
43851 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
43852 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
43853 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
43854 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
43855 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
43856 Self::SET_MAG_OFFSETS(..) => SET_MAG_OFFSETS_DATA::ID,
43857 Self::SET_MODE(..) => SET_MODE_DATA::ID,
43858 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
43859 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
43860 Self::SIMSTATE(..) => SIMSTATE_DATA::ID,
43861 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
43862 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
43863 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
43864 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
43865 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
43866 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
43867 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
43868 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
43869 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
43870 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
43871 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
43872 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
43873 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
43874 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
43875 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
43876 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
43877 }
43878 Self::TUNNEL(..) => TUNNEL_DATA::ID,
43879 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
43880 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
43881 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::ID,
43882 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::ID,
43883 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID,
43884 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
43885 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID
43886 }
43887 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::ID,
43888 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID,
43889 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::ID,
43890 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
43891 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID
43892 }
43893 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
43894 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
43895 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
43896 Self::VIBRATION(..) => VIBRATION_DATA::ID,
43897 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
43898 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
43899 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
43900 Self::VISION_POSITION_DELTA(..) => VISION_POSITION_DELTA_DATA::ID,
43901 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
43902 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
43903 Self::WATER_DEPTH(..) => WATER_DEPTH_DATA::ID,
43904 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
43905 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
43906 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
43907 Self::WIND(..) => WIND_DATA::ID,
43908 Self::WIND_COV(..) => WIND_COV_DATA::ID,
43909 }
43910 }
43911 fn message_id_from_name(name: &str) -> Option<u32> {
43912 match name {
43913 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
43914 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
43915 ADAP_TUNING_DATA::NAME => Some(ADAP_TUNING_DATA::ID),
43916 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
43917 AHRS_DATA::NAME => Some(AHRS_DATA::ID),
43918 AHRS2_DATA::NAME => Some(AHRS2_DATA::ID),
43919 AHRS3_DATA::NAME => Some(AHRS3_DATA::ID),
43920 AIRLINK_AUTH_DATA::NAME => Some(AIRLINK_AUTH_DATA::ID),
43921 AIRLINK_AUTH_RESPONSE_DATA::NAME => Some(AIRLINK_AUTH_RESPONSE_DATA::ID),
43922 AIRSPEED_AUTOCAL_DATA::NAME => Some(AIRSPEED_AUTOCAL_DATA::ID),
43923 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
43924 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
43925 AOA_SSA_DATA::NAME => Some(AOA_SSA_DATA::ID),
43926 AP_ADC_DATA::NAME => Some(AP_ADC_DATA::ID),
43927 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
43928 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
43929 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
43930 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
43931 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
43932 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
43933 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
43934 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
43935 }
43936 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
43937 AUTOPILOT_VERSION_REQUEST_DATA::NAME => Some(AUTOPILOT_VERSION_REQUEST_DATA::ID),
43938 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
43939 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
43940 BATTERY2_DATA::NAME => Some(BATTERY2_DATA::ID),
43941 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
43942 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
43943 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
43944 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
43945 CAMERA_FEEDBACK_DATA::NAME => Some(CAMERA_FEEDBACK_DATA::ID),
43946 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
43947 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
43948 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
43949 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
43950 CAMERA_STATUS_DATA::NAME => Some(CAMERA_STATUS_DATA::ID),
43951 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
43952 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
43953 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
43954 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
43955 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
43956 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
43957 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
43958 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
43959 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
43960 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
43961 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
43962 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
43963 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
43964 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
43965 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
43966 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
43967 COMPASSMOT_STATUS_DATA::NAME => Some(COMPASSMOT_STATUS_DATA::ID),
43968 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
43969 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
43970 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
43971 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
43972 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::NAME => {
43973 Some(CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID)
43974 }
43975 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::NAME => {
43976 Some(CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID)
43977 }
43978 CUBEPILOT_RAW_RC_DATA::NAME => Some(CUBEPILOT_RAW_RC_DATA::ID),
43979 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
43980 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
43981 DATA16_DATA::NAME => Some(DATA16_DATA::ID),
43982 DATA32_DATA::NAME => Some(DATA32_DATA::ID),
43983 DATA64_DATA::NAME => Some(DATA64_DATA::ID),
43984 DATA96_DATA::NAME => Some(DATA96_DATA::ID),
43985 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
43986 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
43987 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
43988 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
43989 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
43990 DEEPSTALL_DATA::NAME => Some(DEEPSTALL_DATA::ID),
43991 DEVICE_OP_READ_DATA::NAME => Some(DEVICE_OP_READ_DATA::ID),
43992 DEVICE_OP_READ_REPLY_DATA::NAME => Some(DEVICE_OP_READ_REPLY_DATA::ID),
43993 DEVICE_OP_WRITE_DATA::NAME => Some(DEVICE_OP_WRITE_DATA::ID),
43994 DEVICE_OP_WRITE_REPLY_DATA::NAME => Some(DEVICE_OP_WRITE_REPLY_DATA::ID),
43995 DIGICAM_CONFIGURE_DATA::NAME => Some(DIGICAM_CONFIGURE_DATA::ID),
43996 DIGICAM_CONTROL_DATA::NAME => Some(DIGICAM_CONTROL_DATA::ID),
43997 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
43998 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
43999 EKF_STATUS_REPORT_DATA::NAME => Some(EKF_STATUS_REPORT_DATA::ID),
44000 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
44001 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
44002 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
44003 ESC_TELEMETRY_13_TO_16_DATA::NAME => Some(ESC_TELEMETRY_13_TO_16_DATA::ID),
44004 ESC_TELEMETRY_17_TO_20_DATA::NAME => Some(ESC_TELEMETRY_17_TO_20_DATA::ID),
44005 ESC_TELEMETRY_1_TO_4_DATA::NAME => Some(ESC_TELEMETRY_1_TO_4_DATA::ID),
44006 ESC_TELEMETRY_21_TO_24_DATA::NAME => Some(ESC_TELEMETRY_21_TO_24_DATA::ID),
44007 ESC_TELEMETRY_25_TO_28_DATA::NAME => Some(ESC_TELEMETRY_25_TO_28_DATA::ID),
44008 ESC_TELEMETRY_29_TO_32_DATA::NAME => Some(ESC_TELEMETRY_29_TO_32_DATA::ID),
44009 ESC_TELEMETRY_5_TO_8_DATA::NAME => Some(ESC_TELEMETRY_5_TO_8_DATA::ID),
44010 ESC_TELEMETRY_9_TO_12_DATA::NAME => Some(ESC_TELEMETRY_9_TO_12_DATA::ID),
44011 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
44012 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
44013 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
44014 FENCE_FETCH_POINT_DATA::NAME => Some(FENCE_FETCH_POINT_DATA::ID),
44015 FENCE_POINT_DATA::NAME => Some(FENCE_POINT_DATA::ID),
44016 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
44017 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
44018 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
44019 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
44020 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
44021 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
44022 GIMBAL_CONTROL_DATA::NAME => Some(GIMBAL_CONTROL_DATA::ID),
44023 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
44024 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
44025 }
44026 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
44027 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
44028 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
44029 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
44030 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
44031 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
44032 }
44033 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
44034 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
44035 GIMBAL_REPORT_DATA::NAME => Some(GIMBAL_REPORT_DATA::ID),
44036 GIMBAL_TORQUE_CMD_REPORT_DATA::NAME => Some(GIMBAL_TORQUE_CMD_REPORT_DATA::ID),
44037 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
44038 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
44039 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
44040 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
44041 }
44042 GOPRO_GET_REQUEST_DATA::NAME => Some(GOPRO_GET_REQUEST_DATA::ID),
44043 GOPRO_GET_RESPONSE_DATA::NAME => Some(GOPRO_GET_RESPONSE_DATA::ID),
44044 GOPRO_HEARTBEAT_DATA::NAME => Some(GOPRO_HEARTBEAT_DATA::ID),
44045 GOPRO_SET_REQUEST_DATA::NAME => Some(GOPRO_SET_REQUEST_DATA::ID),
44046 GOPRO_SET_RESPONSE_DATA::NAME => Some(GOPRO_SET_RESPONSE_DATA::ID),
44047 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
44048 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
44049 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
44050 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
44051 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
44052 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
44053 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
44054 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
44055 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
44056 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
44057 HERELINK_TELEM_DATA::NAME => Some(HERELINK_TELEM_DATA::ID),
44058 HERELINK_VIDEO_STREAM_INFORMATION_DATA::NAME => {
44059 Some(HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID)
44060 }
44061 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
44062 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
44063 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
44064 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
44065 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
44066 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
44067 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
44068 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
44069 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
44070 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
44071 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
44072 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
44073 HWSTATUS_DATA::NAME => Some(HWSTATUS_DATA::ID),
44074 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
44075 ICAROUS_HEARTBEAT_DATA::NAME => Some(ICAROUS_HEARTBEAT_DATA::ID),
44076 ICAROUS_KINEMATIC_BANDS_DATA::NAME => Some(ICAROUS_KINEMATIC_BANDS_DATA::ID),
44077 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
44078 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
44079 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
44080 LED_CONTROL_DATA::NAME => Some(LED_CONTROL_DATA::ID),
44081 LIMITS_STATUS_DATA::NAME => Some(LIMITS_STATUS_DATA::ID),
44082 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
44083 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
44084 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
44085 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
44086 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
44087 }
44088 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
44089 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
44090 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
44091 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
44092 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
44093 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
44094 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
44095 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
44096 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
44097 LOWEHEISER_GOV_EFI_DATA::NAME => Some(LOWEHEISER_GOV_EFI_DATA::ID),
44098 MAG_CAL_PROGRESS_DATA::NAME => Some(MAG_CAL_PROGRESS_DATA::ID),
44099 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
44100 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
44101 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
44102 MCU_STATUS_DATA::NAME => Some(MCU_STATUS_DATA::ID),
44103 MEMINFO_DATA::NAME => Some(MEMINFO_DATA::ID),
44104 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
44105 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
44106 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
44107 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
44108 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
44109 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
44110 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
44111 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
44112 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
44113 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
44114 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
44115 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
44116 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
44117 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
44118 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
44119 MOUNT_CONFIGURE_DATA::NAME => Some(MOUNT_CONFIGURE_DATA::ID),
44120 MOUNT_CONTROL_DATA::NAME => Some(MOUNT_CONTROL_DATA::ID),
44121 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
44122 MOUNT_STATUS_DATA::NAME => Some(MOUNT_STATUS_DATA::ID),
44123 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
44124 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
44125 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
44126 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
44127 OBSTACLE_DISTANCE_3D_DATA::NAME => Some(OBSTACLE_DISTANCE_3D_DATA::ID),
44128 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
44129 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
44130 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
44131 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
44132 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
44133 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
44134 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
44135 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
44136 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
44137 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
44138 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
44139 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
44140 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
44141 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
44142 OSD_PARAM_CONFIG_DATA::NAME => Some(OSD_PARAM_CONFIG_DATA::ID),
44143 OSD_PARAM_CONFIG_REPLY_DATA::NAME => Some(OSD_PARAM_CONFIG_REPLY_DATA::ID),
44144 OSD_PARAM_SHOW_CONFIG_DATA::NAME => Some(OSD_PARAM_SHOW_CONFIG_DATA::ID),
44145 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::NAME => Some(OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID),
44146 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
44147 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
44148 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
44149 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
44150 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
44151 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
44152 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
44153 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
44154 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
44155 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
44156 PID_TUNING_DATA::NAME => Some(PID_TUNING_DATA::ID),
44157 PING_DATA::NAME => Some(PING_DATA::ID),
44158 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
44159 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
44160 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
44161 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
44162 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
44163 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
44164 RADIO_DATA::NAME => Some(RADIO_DATA::ID),
44165 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
44166 RALLY_FETCH_POINT_DATA::NAME => Some(RALLY_FETCH_POINT_DATA::ID),
44167 RALLY_POINT_DATA::NAME => Some(RALLY_POINT_DATA::ID),
44168 RANGEFINDER_DATA::NAME => Some(RANGEFINDER_DATA::ID),
44169 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
44170 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
44171 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
44172 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
44173 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
44174 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
44175 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
44176 REMOTE_LOG_BLOCK_STATUS_DATA::NAME => Some(REMOTE_LOG_BLOCK_STATUS_DATA::ID),
44177 REMOTE_LOG_DATA_BLOCK_DATA::NAME => Some(REMOTE_LOG_DATA_BLOCK_DATA::ID),
44178 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
44179 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
44180 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
44181 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
44182 RPM_DATA::NAME => Some(RPM_DATA::ID),
44183 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
44184 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
44185 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
44186 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
44187 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
44188 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
44189 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
44190 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
44191 SECURE_COMMAND_DATA::NAME => Some(SECURE_COMMAND_DATA::ID),
44192 SECURE_COMMAND_REPLY_DATA::NAME => Some(SECURE_COMMAND_REPLY_DATA::ID),
44193 SENSOR_OFFSETS_DATA::NAME => Some(SENSOR_OFFSETS_DATA::ID),
44194 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
44195 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
44196 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
44197 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
44198 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
44199 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
44200 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
44201 SET_MAG_OFFSETS_DATA::NAME => Some(SET_MAG_OFFSETS_DATA::ID),
44202 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
44203 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
44204 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
44205 }
44206 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
44207 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
44208 }
44209 SIMSTATE_DATA::NAME => Some(SIMSTATE_DATA::ID),
44210 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
44211 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
44212 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
44213 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
44214 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
44215 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
44216 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
44217 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
44218 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
44219 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
44220 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
44221 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
44222 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
44223 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
44224 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
44225 }
44226 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
44227 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
44228 }
44229 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
44230 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
44231 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
44232 UAVIONIX_ADSB_GET_DATA::NAME => Some(UAVIONIX_ADSB_GET_DATA::ID),
44233 UAVIONIX_ADSB_OUT_CFG_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CFG_DATA::ID),
44234 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME => {
44235 Some(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID)
44236 }
44237 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME => {
44238 Some(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID)
44239 }
44240 UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CONTROL_DATA::ID),
44241 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME => Some(UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID),
44242 UAVIONIX_ADSB_OUT_STATUS_DATA::NAME => Some(UAVIONIX_ADSB_OUT_STATUS_DATA::ID),
44243 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME => {
44244 Some(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID)
44245 }
44246 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
44247 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
44248 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
44249 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
44250 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
44251 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
44252 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
44253 VISION_POSITION_DELTA_DATA::NAME => Some(VISION_POSITION_DELTA_DATA::ID),
44254 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
44255 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
44256 WATER_DEPTH_DATA::NAME => Some(WATER_DEPTH_DATA::ID),
44257 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
44258 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
44259 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
44260 WIND_DATA::NAME => Some(WIND_DATA::ID),
44261 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
44262 _ => None,
44263 }
44264 }
44265 fn default_message_from_id(id: u32) -> Option<Self> {
44266 match id {
44267 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
44268 ACTUATOR_CONTROL_TARGET_DATA::default(),
44269 )),
44270 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
44271 ACTUATOR_OUTPUT_STATUS_DATA::default(),
44272 )),
44273 ADAP_TUNING_DATA::ID => Some(Self::ADAP_TUNING(ADAP_TUNING_DATA::default())),
44274 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
44275 AHRS_DATA::ID => Some(Self::AHRS(AHRS_DATA::default())),
44276 AHRS2_DATA::ID => Some(Self::AHRS2(AHRS2_DATA::default())),
44277 AHRS3_DATA::ID => Some(Self::AHRS3(AHRS3_DATA::default())),
44278 AIRLINK_AUTH_DATA::ID => Some(Self::AIRLINK_AUTH(AIRLINK_AUTH_DATA::default())),
44279 AIRLINK_AUTH_RESPONSE_DATA::ID => Some(Self::AIRLINK_AUTH_RESPONSE(
44280 AIRLINK_AUTH_RESPONSE_DATA::default(),
44281 )),
44282 AIRSPEED_AUTOCAL_DATA::ID => {
44283 Some(Self::AIRSPEED_AUTOCAL(AIRSPEED_AUTOCAL_DATA::default()))
44284 }
44285 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
44286 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
44287 AOA_SSA_DATA::ID => Some(Self::AOA_SSA(AOA_SSA_DATA::default())),
44288 AP_ADC_DATA::ID => Some(Self::AP_ADC(AP_ADC_DATA::default())),
44289 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
44290 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
44291 ATTITUDE_QUATERNION_DATA::default(),
44292 )),
44293 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
44294 ATTITUDE_QUATERNION_COV_DATA::default(),
44295 )),
44296 ATTITUDE_TARGET_DATA::ID => {
44297 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
44298 }
44299 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
44300 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
44301 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
44302 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
44303 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
44304 ))
44305 }
44306 AUTOPILOT_VERSION_DATA::ID => {
44307 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
44308 }
44309 AUTOPILOT_VERSION_REQUEST_DATA::ID => Some(Self::AUTOPILOT_VERSION_REQUEST(
44310 AUTOPILOT_VERSION_REQUEST_DATA::default(),
44311 )),
44312 AVAILABLE_MODES_DATA::ID => {
44313 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
44314 }
44315 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
44316 AVAILABLE_MODES_MONITOR_DATA::default(),
44317 )),
44318 BATTERY2_DATA::ID => Some(Self::BATTERY2(BATTERY2_DATA::default())),
44319 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
44320 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
44321 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
44322 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
44323 CAMERA_CAPTURE_STATUS_DATA::default(),
44324 )),
44325 CAMERA_FEEDBACK_DATA::ID => {
44326 Some(Self::CAMERA_FEEDBACK(CAMERA_FEEDBACK_DATA::default()))
44327 }
44328 CAMERA_FOV_STATUS_DATA::ID => {
44329 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
44330 }
44331 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
44332 CAMERA_IMAGE_CAPTURED_DATA::default(),
44333 )),
44334 CAMERA_INFORMATION_DATA::ID => {
44335 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
44336 }
44337 CAMERA_SETTINGS_DATA::ID => {
44338 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
44339 }
44340 CAMERA_STATUS_DATA::ID => Some(Self::CAMERA_STATUS(CAMERA_STATUS_DATA::default())),
44341 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
44342 CAMERA_THERMAL_RANGE_DATA::default(),
44343 )),
44344 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
44345 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
44346 )),
44347 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
44348 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
44349 )),
44350 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
44351 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
44352 CAN_FILTER_MODIFY_DATA::ID => {
44353 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
44354 }
44355 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
44356 CELLULAR_CONFIG_DATA::ID => {
44357 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
44358 }
44359 CELLULAR_STATUS_DATA::ID => {
44360 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
44361 }
44362 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
44363 CHANGE_OPERATOR_CONTROL_DATA::default(),
44364 )),
44365 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
44366 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
44367 )),
44368 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
44369 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
44370 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
44371 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
44372 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
44373 COMPASSMOT_STATUS_DATA::ID => {
44374 Some(Self::COMPASSMOT_STATUS(COMPASSMOT_STATUS_DATA::default()))
44375 }
44376 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
44377 COMPONENT_INFORMATION_DATA::default(),
44378 )),
44379 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
44380 COMPONENT_INFORMATION_BASIC_DATA::default(),
44381 )),
44382 COMPONENT_METADATA_DATA::ID => {
44383 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
44384 }
44385 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
44386 CONTROL_SYSTEM_STATE_DATA::default(),
44387 )),
44388 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
44389 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::default(),
44390 )),
44391 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
44392 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
44393 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::default(),
44394 ))
44395 }
44396 CUBEPILOT_RAW_RC_DATA::ID => {
44397 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::default()))
44398 }
44399 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
44400 CURRENT_EVENT_SEQUENCE_DATA::default(),
44401 )),
44402 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
44403 DATA16_DATA::ID => Some(Self::DATA16(DATA16_DATA::default())),
44404 DATA32_DATA::ID => Some(Self::DATA32(DATA32_DATA::default())),
44405 DATA64_DATA::ID => Some(Self::DATA64(DATA64_DATA::default())),
44406 DATA96_DATA::ID => Some(Self::DATA96(DATA96_DATA::default())),
44407 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
44408 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
44409 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
44410 )),
44411 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
44412 DEBUG_FLOAT_ARRAY_DATA::ID => {
44413 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
44414 }
44415 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
44416 DEEPSTALL_DATA::ID => Some(Self::DEEPSTALL(DEEPSTALL_DATA::default())),
44417 DEVICE_OP_READ_DATA::ID => Some(Self::DEVICE_OP_READ(DEVICE_OP_READ_DATA::default())),
44418 DEVICE_OP_READ_REPLY_DATA::ID => Some(Self::DEVICE_OP_READ_REPLY(
44419 DEVICE_OP_READ_REPLY_DATA::default(),
44420 )),
44421 DEVICE_OP_WRITE_DATA::ID => {
44422 Some(Self::DEVICE_OP_WRITE(DEVICE_OP_WRITE_DATA::default()))
44423 }
44424 DEVICE_OP_WRITE_REPLY_DATA::ID => Some(Self::DEVICE_OP_WRITE_REPLY(
44425 DEVICE_OP_WRITE_REPLY_DATA::default(),
44426 )),
44427 DIGICAM_CONFIGURE_DATA::ID => {
44428 Some(Self::DIGICAM_CONFIGURE(DIGICAM_CONFIGURE_DATA::default()))
44429 }
44430 DIGICAM_CONTROL_DATA::ID => {
44431 Some(Self::DIGICAM_CONTROL(DIGICAM_CONTROL_DATA::default()))
44432 }
44433 DISTANCE_SENSOR_DATA::ID => {
44434 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
44435 }
44436 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
44437 EKF_STATUS_REPORT_DATA::ID => {
44438 Some(Self::EKF_STATUS_REPORT(EKF_STATUS_REPORT_DATA::default()))
44439 }
44440 ENCAPSULATED_DATA_DATA::ID => {
44441 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
44442 }
44443 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
44444 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
44445 ESC_TELEMETRY_13_TO_16_DATA::ID => Some(Self::ESC_TELEMETRY_13_TO_16(
44446 ESC_TELEMETRY_13_TO_16_DATA::default(),
44447 )),
44448 ESC_TELEMETRY_17_TO_20_DATA::ID => Some(Self::ESC_TELEMETRY_17_TO_20(
44449 ESC_TELEMETRY_17_TO_20_DATA::default(),
44450 )),
44451 ESC_TELEMETRY_1_TO_4_DATA::ID => Some(Self::ESC_TELEMETRY_1_TO_4(
44452 ESC_TELEMETRY_1_TO_4_DATA::default(),
44453 )),
44454 ESC_TELEMETRY_21_TO_24_DATA::ID => Some(Self::ESC_TELEMETRY_21_TO_24(
44455 ESC_TELEMETRY_21_TO_24_DATA::default(),
44456 )),
44457 ESC_TELEMETRY_25_TO_28_DATA::ID => Some(Self::ESC_TELEMETRY_25_TO_28(
44458 ESC_TELEMETRY_25_TO_28_DATA::default(),
44459 )),
44460 ESC_TELEMETRY_29_TO_32_DATA::ID => Some(Self::ESC_TELEMETRY_29_TO_32(
44461 ESC_TELEMETRY_29_TO_32_DATA::default(),
44462 )),
44463 ESC_TELEMETRY_5_TO_8_DATA::ID => Some(Self::ESC_TELEMETRY_5_TO_8(
44464 ESC_TELEMETRY_5_TO_8_DATA::default(),
44465 )),
44466 ESC_TELEMETRY_9_TO_12_DATA::ID => Some(Self::ESC_TELEMETRY_9_TO_12(
44467 ESC_TELEMETRY_9_TO_12_DATA::default(),
44468 )),
44469 ESTIMATOR_STATUS_DATA::ID => {
44470 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
44471 }
44472 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
44473 EXTENDED_SYS_STATE_DATA::ID => {
44474 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
44475 }
44476 FENCE_FETCH_POINT_DATA::ID => {
44477 Some(Self::FENCE_FETCH_POINT(FENCE_FETCH_POINT_DATA::default()))
44478 }
44479 FENCE_POINT_DATA::ID => Some(Self::FENCE_POINT(FENCE_POINT_DATA::default())),
44480 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
44481 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
44482 FILE_TRANSFER_PROTOCOL_DATA::default(),
44483 )),
44484 FLIGHT_INFORMATION_DATA::ID => {
44485 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
44486 }
44487 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
44488 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
44489 GENERATOR_STATUS_DATA::ID => {
44490 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
44491 }
44492 GIMBAL_CONTROL_DATA::ID => Some(Self::GIMBAL_CONTROL(GIMBAL_CONTROL_DATA::default())),
44493 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
44494 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
44495 )),
44496 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
44497 GIMBAL_DEVICE_INFORMATION_DATA::default(),
44498 )),
44499 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
44500 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
44501 )),
44502 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
44503 GIMBAL_MANAGER_INFORMATION_DATA::default(),
44504 )),
44505 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
44506 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
44507 )),
44508 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
44509 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
44510 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
44511 ))
44512 }
44513 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
44514 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
44515 )),
44516 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
44517 GIMBAL_MANAGER_STATUS_DATA::default(),
44518 )),
44519 GIMBAL_REPORT_DATA::ID => Some(Self::GIMBAL_REPORT(GIMBAL_REPORT_DATA::default())),
44520 GIMBAL_TORQUE_CMD_REPORT_DATA::ID => Some(Self::GIMBAL_TORQUE_CMD_REPORT(
44521 GIMBAL_TORQUE_CMD_REPORT_DATA::default(),
44522 )),
44523 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
44524 GLOBAL_POSITION_INT_DATA::default(),
44525 )),
44526 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
44527 GLOBAL_POSITION_INT_COV_DATA::default(),
44528 )),
44529 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
44530 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
44531 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
44532 ))
44533 }
44534 GOPRO_GET_REQUEST_DATA::ID => {
44535 Some(Self::GOPRO_GET_REQUEST(GOPRO_GET_REQUEST_DATA::default()))
44536 }
44537 GOPRO_GET_RESPONSE_DATA::ID => {
44538 Some(Self::GOPRO_GET_RESPONSE(GOPRO_GET_RESPONSE_DATA::default()))
44539 }
44540 GOPRO_HEARTBEAT_DATA::ID => {
44541 Some(Self::GOPRO_HEARTBEAT(GOPRO_HEARTBEAT_DATA::default()))
44542 }
44543 GOPRO_SET_REQUEST_DATA::ID => {
44544 Some(Self::GOPRO_SET_REQUEST(GOPRO_SET_REQUEST_DATA::default()))
44545 }
44546 GOPRO_SET_RESPONSE_DATA::ID => {
44547 Some(Self::GOPRO_SET_RESPONSE(GOPRO_SET_RESPONSE_DATA::default()))
44548 }
44549 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
44550 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
44551 GPS_GLOBAL_ORIGIN_DATA::ID => {
44552 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
44553 }
44554 GPS_INJECT_DATA_DATA::ID => {
44555 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
44556 }
44557 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
44558 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
44559 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
44560 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
44561 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
44562 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
44563 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::default())),
44564 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
44565 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
44566 HERELINK_VIDEO_STREAM_INFORMATION_DATA::default(),
44567 ))
44568 }
44569 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
44570 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
44571 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
44572 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
44573 HIL_ACTUATOR_CONTROLS_DATA::default(),
44574 )),
44575 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
44576 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
44577 HIL_OPTICAL_FLOW_DATA::ID => {
44578 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
44579 }
44580 HIL_RC_INPUTS_RAW_DATA::ID => {
44581 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
44582 }
44583 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
44584 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
44585 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
44586 HIL_STATE_QUATERNION_DATA::default(),
44587 )),
44588 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
44589 HWSTATUS_DATA::ID => Some(Self::HWSTATUS(HWSTATUS_DATA::default())),
44590 HYGROMETER_SENSOR_DATA::ID => {
44591 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
44592 }
44593 ICAROUS_HEARTBEAT_DATA::ID => {
44594 Some(Self::ICAROUS_HEARTBEAT(ICAROUS_HEARTBEAT_DATA::default()))
44595 }
44596 ICAROUS_KINEMATIC_BANDS_DATA::ID => Some(Self::ICAROUS_KINEMATIC_BANDS(
44597 ICAROUS_KINEMATIC_BANDS_DATA::default(),
44598 )),
44599 ILLUMINATOR_STATUS_DATA::ID => {
44600 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
44601 }
44602 ISBD_LINK_STATUS_DATA::ID => {
44603 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
44604 }
44605 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
44606 LED_CONTROL_DATA::ID => Some(Self::LED_CONTROL(LED_CONTROL_DATA::default())),
44607 LIMITS_STATUS_DATA::ID => Some(Self::LIMITS_STATUS(LIMITS_STATUS_DATA::default())),
44608 LINK_NODE_STATUS_DATA::ID => {
44609 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
44610 }
44611 LOCAL_POSITION_NED_DATA::ID => {
44612 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
44613 }
44614 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
44615 LOCAL_POSITION_NED_COV_DATA::default(),
44616 )),
44617 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
44618 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
44619 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
44620 ))
44621 }
44622 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
44623 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
44624 LOGGING_DATA_ACKED_DATA::ID => {
44625 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
44626 }
44627 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
44628 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
44629 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
44630 LOG_REQUEST_DATA_DATA::ID => {
44631 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
44632 }
44633 LOG_REQUEST_END_DATA::ID => {
44634 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
44635 }
44636 LOG_REQUEST_LIST_DATA::ID => {
44637 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
44638 }
44639 LOWEHEISER_GOV_EFI_DATA::ID => {
44640 Some(Self::LOWEHEISER_GOV_EFI(LOWEHEISER_GOV_EFI_DATA::default()))
44641 }
44642 MAG_CAL_PROGRESS_DATA::ID => {
44643 Some(Self::MAG_CAL_PROGRESS(MAG_CAL_PROGRESS_DATA::default()))
44644 }
44645 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
44646 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
44647 MANUAL_SETPOINT_DATA::ID => {
44648 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
44649 }
44650 MCU_STATUS_DATA::ID => Some(Self::MCU_STATUS(MCU_STATUS_DATA::default())),
44651 MEMINFO_DATA::ID => Some(Self::MEMINFO(MEMINFO_DATA::default())),
44652 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
44653 MESSAGE_INTERVAL_DATA::ID => {
44654 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
44655 }
44656 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
44657 MISSION_CLEAR_ALL_DATA::ID => {
44658 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
44659 }
44660 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
44661 MISSION_CURRENT_DATA::ID => {
44662 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
44663 }
44664 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
44665 MISSION_ITEM_INT_DATA::ID => {
44666 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
44667 }
44668 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
44669 MISSION_ITEM_REACHED_DATA::default(),
44670 )),
44671 MISSION_REQUEST_DATA::ID => {
44672 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
44673 }
44674 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
44675 MISSION_REQUEST_INT_DATA::default(),
44676 )),
44677 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
44678 MISSION_REQUEST_LIST_DATA::default(),
44679 )),
44680 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
44681 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
44682 )),
44683 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
44684 MISSION_SET_CURRENT_DATA::default(),
44685 )),
44686 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
44687 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
44688 )),
44689 MOUNT_CONFIGURE_DATA::ID => {
44690 Some(Self::MOUNT_CONFIGURE(MOUNT_CONFIGURE_DATA::default()))
44691 }
44692 MOUNT_CONTROL_DATA::ID => Some(Self::MOUNT_CONTROL(MOUNT_CONTROL_DATA::default())),
44693 MOUNT_ORIENTATION_DATA::ID => {
44694 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
44695 }
44696 MOUNT_STATUS_DATA::ID => Some(Self::MOUNT_STATUS(MOUNT_STATUS_DATA::default())),
44697 NAMED_VALUE_FLOAT_DATA::ID => {
44698 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
44699 }
44700 NAMED_VALUE_INT_DATA::ID => {
44701 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
44702 }
44703 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
44704 NAV_CONTROLLER_OUTPUT_DATA::default(),
44705 )),
44706 OBSTACLE_DISTANCE_DATA::ID => {
44707 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
44708 }
44709 OBSTACLE_DISTANCE_3D_DATA::ID => Some(Self::OBSTACLE_DISTANCE_3D(
44710 OBSTACLE_DISTANCE_3D_DATA::default(),
44711 )),
44712 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
44713 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
44714 ONBOARD_COMPUTER_STATUS_DATA::default(),
44715 )),
44716 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
44717 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
44718 )),
44719 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
44720 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
44721 )),
44722 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
44723 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
44724 )),
44725 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
44726 OPEN_DRONE_ID_LOCATION_DATA::default(),
44727 )),
44728 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
44729 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
44730 )),
44731 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
44732 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
44733 )),
44734 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
44735 OPEN_DRONE_ID_SELF_ID_DATA::default(),
44736 )),
44737 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
44738 OPEN_DRONE_ID_SYSTEM_DATA::default(),
44739 )),
44740 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
44741 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
44742 )),
44743 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
44744 OPTICAL_FLOW_RAD_DATA::ID => {
44745 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
44746 }
44747 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
44748 ORBIT_EXECUTION_STATUS_DATA::default(),
44749 )),
44750 OSD_PARAM_CONFIG_DATA::ID => {
44751 Some(Self::OSD_PARAM_CONFIG(OSD_PARAM_CONFIG_DATA::default()))
44752 }
44753 OSD_PARAM_CONFIG_REPLY_DATA::ID => Some(Self::OSD_PARAM_CONFIG_REPLY(
44754 OSD_PARAM_CONFIG_REPLY_DATA::default(),
44755 )),
44756 OSD_PARAM_SHOW_CONFIG_DATA::ID => Some(Self::OSD_PARAM_SHOW_CONFIG(
44757 OSD_PARAM_SHOW_CONFIG_DATA::default(),
44758 )),
44759 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID => Some(Self::OSD_PARAM_SHOW_CONFIG_REPLY(
44760 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::default(),
44761 )),
44762 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
44763 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
44764 PARAM_EXT_REQUEST_LIST_DATA::default(),
44765 )),
44766 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
44767 PARAM_EXT_REQUEST_READ_DATA::default(),
44768 )),
44769 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
44770 PARAM_EXT_VALUE_DATA::ID => {
44771 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
44772 }
44773 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
44774 PARAM_REQUEST_LIST_DATA::ID => {
44775 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
44776 }
44777 PARAM_REQUEST_READ_DATA::ID => {
44778 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
44779 }
44780 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
44781 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
44782 PID_TUNING_DATA::ID => Some(Self::PID_TUNING(PID_TUNING_DATA::default())),
44783 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
44784 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
44785 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
44786 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
44787 POSITION_TARGET_GLOBAL_INT_DATA::default(),
44788 )),
44789 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
44790 POSITION_TARGET_LOCAL_NED_DATA::default(),
44791 )),
44792 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
44793 PROTOCOL_VERSION_DATA::ID => {
44794 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
44795 }
44796 RADIO_DATA::ID => Some(Self::RADIO(RADIO_DATA::default())),
44797 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
44798 RALLY_FETCH_POINT_DATA::ID => {
44799 Some(Self::RALLY_FETCH_POINT(RALLY_FETCH_POINT_DATA::default()))
44800 }
44801 RALLY_POINT_DATA::ID => Some(Self::RALLY_POINT(RALLY_POINT_DATA::default())),
44802 RANGEFINDER_DATA::ID => Some(Self::RANGEFINDER(RANGEFINDER_DATA::default())),
44803 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
44804 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
44805 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
44806 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
44807 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
44808 RC_CHANNELS_OVERRIDE_DATA::default(),
44809 )),
44810 RC_CHANNELS_RAW_DATA::ID => {
44811 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
44812 }
44813 RC_CHANNELS_SCALED_DATA::ID => {
44814 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
44815 }
44816 REMOTE_LOG_BLOCK_STATUS_DATA::ID => Some(Self::REMOTE_LOG_BLOCK_STATUS(
44817 REMOTE_LOG_BLOCK_STATUS_DATA::default(),
44818 )),
44819 REMOTE_LOG_DATA_BLOCK_DATA::ID => Some(Self::REMOTE_LOG_DATA_BLOCK(
44820 REMOTE_LOG_DATA_BLOCK_DATA::default(),
44821 )),
44822 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
44823 REQUEST_DATA_STREAM_DATA::default(),
44824 )),
44825 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
44826 RESOURCE_REQUEST_DATA::ID => {
44827 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
44828 }
44829 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
44830 RESPONSE_EVENT_ERROR_DATA::default(),
44831 )),
44832 RPM_DATA::ID => Some(Self::RPM(RPM_DATA::default())),
44833 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
44834 SAFETY_ALLOWED_AREA_DATA::default(),
44835 )),
44836 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
44837 SAFETY_SET_ALLOWED_AREA_DATA::default(),
44838 )),
44839 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
44840 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
44841 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
44842 SCALED_PRESSURE_DATA::ID => {
44843 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
44844 }
44845 SCALED_PRESSURE2_DATA::ID => {
44846 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
44847 }
44848 SCALED_PRESSURE3_DATA::ID => {
44849 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
44850 }
44851 SECURE_COMMAND_DATA::ID => Some(Self::SECURE_COMMAND(SECURE_COMMAND_DATA::default())),
44852 SECURE_COMMAND_REPLY_DATA::ID => Some(Self::SECURE_COMMAND_REPLY(
44853 SECURE_COMMAND_REPLY_DATA::default(),
44854 )),
44855 SENSOR_OFFSETS_DATA::ID => Some(Self::SENSOR_OFFSETS(SENSOR_OFFSETS_DATA::default())),
44856 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
44857 SERVO_OUTPUT_RAW_DATA::ID => {
44858 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
44859 }
44860 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
44861 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
44862 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
44863 )),
44864 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
44865 SET_ATTITUDE_TARGET_DATA::default(),
44866 )),
44867 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
44868 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
44869 )),
44870 SET_HOME_POSITION_DATA::ID => {
44871 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
44872 }
44873 SET_MAG_OFFSETS_DATA::ID => {
44874 Some(Self::SET_MAG_OFFSETS(SET_MAG_OFFSETS_DATA::default()))
44875 }
44876 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
44877 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
44878 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
44879 )),
44880 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
44881 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
44882 )),
44883 SIMSTATE_DATA::ID => Some(Self::SIMSTATE(SIMSTATE_DATA::default())),
44884 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
44885 SMART_BATTERY_INFO_DATA::ID => {
44886 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
44887 }
44888 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
44889 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
44890 STORAGE_INFORMATION_DATA::default(),
44891 )),
44892 SUPPORTED_TUNES_DATA::ID => {
44893 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
44894 }
44895 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
44896 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
44897 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
44898 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
44899 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
44900 TERRAIN_REQUEST_DATA::ID => {
44901 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
44902 }
44903 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
44904 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
44905 TIME_ESTIMATE_TO_TARGET_DATA::default(),
44906 )),
44907 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
44908 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
44909 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
44910 ))
44911 }
44912 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
44913 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
44914 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
44915 ))
44916 }
44917 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
44918 UAVCAN_NODE_INFO_DATA::ID => {
44919 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
44920 }
44921 UAVCAN_NODE_STATUS_DATA::ID => {
44922 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
44923 }
44924 UAVIONIX_ADSB_GET_DATA::ID => {
44925 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::default()))
44926 }
44927 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
44928 UAVIONIX_ADSB_OUT_CFG_DATA::default(),
44929 )),
44930 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
44931 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::default(),
44932 )),
44933 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
44934 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
44935 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::default(),
44936 ))
44937 }
44938 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
44939 UAVIONIX_ADSB_OUT_CONTROL_DATA::default(),
44940 )),
44941 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
44942 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::default(),
44943 )),
44944 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
44945 UAVIONIX_ADSB_OUT_STATUS_DATA::default(),
44946 )),
44947 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
44948 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
44949 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::default(),
44950 ))
44951 }
44952 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
44953 UTM_GLOBAL_POSITION_DATA::default(),
44954 )),
44955 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
44956 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
44957 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
44958 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
44959 VICON_POSITION_ESTIMATE_DATA::default(),
44960 )),
44961 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
44962 VIDEO_STREAM_INFORMATION_DATA::default(),
44963 )),
44964 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
44965 VIDEO_STREAM_STATUS_DATA::default(),
44966 )),
44967 VISION_POSITION_DELTA_DATA::ID => Some(Self::VISION_POSITION_DELTA(
44968 VISION_POSITION_DELTA_DATA::default(),
44969 )),
44970 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
44971 VISION_POSITION_ESTIMATE_DATA::default(),
44972 )),
44973 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
44974 VISION_SPEED_ESTIMATE_DATA::default(),
44975 )),
44976 WATER_DEPTH_DATA::ID => Some(Self::WATER_DEPTH(WATER_DEPTH_DATA::default())),
44977 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
44978 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
44979 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
44980 WIND_DATA::ID => Some(Self::WIND(WIND_DATA::default())),
44981 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
44982 _ => None,
44983 }
44984 }
44985 #[cfg(feature = "arbitrary")]
44986 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
44987 match id {
44988 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
44989 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
44990 )),
44991 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
44992 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
44993 )),
44994 ADAP_TUNING_DATA::ID => Some(Self::ADAP_TUNING(ADAP_TUNING_DATA::random(rng))),
44995 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
44996 AHRS_DATA::ID => Some(Self::AHRS(AHRS_DATA::random(rng))),
44997 AHRS2_DATA::ID => Some(Self::AHRS2(AHRS2_DATA::random(rng))),
44998 AHRS3_DATA::ID => Some(Self::AHRS3(AHRS3_DATA::random(rng))),
44999 AIRLINK_AUTH_DATA::ID => Some(Self::AIRLINK_AUTH(AIRLINK_AUTH_DATA::random(rng))),
45000 AIRLINK_AUTH_RESPONSE_DATA::ID => Some(Self::AIRLINK_AUTH_RESPONSE(
45001 AIRLINK_AUTH_RESPONSE_DATA::random(rng),
45002 )),
45003 AIRSPEED_AUTOCAL_DATA::ID => {
45004 Some(Self::AIRSPEED_AUTOCAL(AIRSPEED_AUTOCAL_DATA::random(rng)))
45005 }
45006 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
45007 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
45008 AOA_SSA_DATA::ID => Some(Self::AOA_SSA(AOA_SSA_DATA::random(rng))),
45009 AP_ADC_DATA::ID => Some(Self::AP_ADC(AP_ADC_DATA::random(rng))),
45010 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
45011 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
45012 ATTITUDE_QUATERNION_DATA::random(rng),
45013 )),
45014 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
45015 ATTITUDE_QUATERNION_COV_DATA::random(rng),
45016 )),
45017 ATTITUDE_TARGET_DATA::ID => {
45018 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
45019 }
45020 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
45021 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
45022 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
45023 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
45024 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
45025 ))
45026 }
45027 AUTOPILOT_VERSION_DATA::ID => {
45028 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
45029 }
45030 AUTOPILOT_VERSION_REQUEST_DATA::ID => Some(Self::AUTOPILOT_VERSION_REQUEST(
45031 AUTOPILOT_VERSION_REQUEST_DATA::random(rng),
45032 )),
45033 AVAILABLE_MODES_DATA::ID => {
45034 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
45035 }
45036 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
45037 AVAILABLE_MODES_MONITOR_DATA::random(rng),
45038 )),
45039 BATTERY2_DATA::ID => Some(Self::BATTERY2(BATTERY2_DATA::random(rng))),
45040 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
45041 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
45042 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
45043 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
45044 CAMERA_CAPTURE_STATUS_DATA::random(rng),
45045 )),
45046 CAMERA_FEEDBACK_DATA::ID => {
45047 Some(Self::CAMERA_FEEDBACK(CAMERA_FEEDBACK_DATA::random(rng)))
45048 }
45049 CAMERA_FOV_STATUS_DATA::ID => {
45050 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
45051 }
45052 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
45053 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
45054 )),
45055 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
45056 CAMERA_INFORMATION_DATA::random(rng),
45057 )),
45058 CAMERA_SETTINGS_DATA::ID => {
45059 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
45060 }
45061 CAMERA_STATUS_DATA::ID => Some(Self::CAMERA_STATUS(CAMERA_STATUS_DATA::random(rng))),
45062 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
45063 CAMERA_THERMAL_RANGE_DATA::random(rng),
45064 )),
45065 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
45066 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
45067 )),
45068 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
45069 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
45070 )),
45071 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
45072 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
45073 CAN_FILTER_MODIFY_DATA::ID => {
45074 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
45075 }
45076 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
45077 CELLULAR_CONFIG_DATA::ID => {
45078 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
45079 }
45080 CELLULAR_STATUS_DATA::ID => {
45081 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
45082 }
45083 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
45084 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
45085 )),
45086 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
45087 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
45088 )),
45089 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
45090 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
45091 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
45092 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
45093 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
45094 COMPASSMOT_STATUS_DATA::ID => {
45095 Some(Self::COMPASSMOT_STATUS(COMPASSMOT_STATUS_DATA::random(rng)))
45096 }
45097 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
45098 COMPONENT_INFORMATION_DATA::random(rng),
45099 )),
45100 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
45101 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
45102 )),
45103 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
45104 COMPONENT_METADATA_DATA::random(rng),
45105 )),
45106 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
45107 CONTROL_SYSTEM_STATE_DATA::random(rng),
45108 )),
45109 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => Some(Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(
45110 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::random(rng),
45111 )),
45112 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
45113 Some(Self::CUBEPILOT_FIRMWARE_UPDATE_START(
45114 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::random(rng),
45115 ))
45116 }
45117 CUBEPILOT_RAW_RC_DATA::ID => {
45118 Some(Self::CUBEPILOT_RAW_RC(CUBEPILOT_RAW_RC_DATA::random(rng)))
45119 }
45120 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
45121 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
45122 )),
45123 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
45124 DATA16_DATA::ID => Some(Self::DATA16(DATA16_DATA::random(rng))),
45125 DATA32_DATA::ID => Some(Self::DATA32(DATA32_DATA::random(rng))),
45126 DATA64_DATA::ID => Some(Self::DATA64(DATA64_DATA::random(rng))),
45127 DATA96_DATA::ID => Some(Self::DATA96(DATA96_DATA::random(rng))),
45128 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
45129 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
45130 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
45131 )),
45132 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
45133 DEBUG_FLOAT_ARRAY_DATA::ID => {
45134 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
45135 }
45136 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
45137 DEEPSTALL_DATA::ID => Some(Self::DEEPSTALL(DEEPSTALL_DATA::random(rng))),
45138 DEVICE_OP_READ_DATA::ID => Some(Self::DEVICE_OP_READ(DEVICE_OP_READ_DATA::random(rng))),
45139 DEVICE_OP_READ_REPLY_DATA::ID => Some(Self::DEVICE_OP_READ_REPLY(
45140 DEVICE_OP_READ_REPLY_DATA::random(rng),
45141 )),
45142 DEVICE_OP_WRITE_DATA::ID => {
45143 Some(Self::DEVICE_OP_WRITE(DEVICE_OP_WRITE_DATA::random(rng)))
45144 }
45145 DEVICE_OP_WRITE_REPLY_DATA::ID => Some(Self::DEVICE_OP_WRITE_REPLY(
45146 DEVICE_OP_WRITE_REPLY_DATA::random(rng),
45147 )),
45148 DIGICAM_CONFIGURE_DATA::ID => {
45149 Some(Self::DIGICAM_CONFIGURE(DIGICAM_CONFIGURE_DATA::random(rng)))
45150 }
45151 DIGICAM_CONTROL_DATA::ID => {
45152 Some(Self::DIGICAM_CONTROL(DIGICAM_CONTROL_DATA::random(rng)))
45153 }
45154 DISTANCE_SENSOR_DATA::ID => {
45155 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
45156 }
45157 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
45158 EKF_STATUS_REPORT_DATA::ID => {
45159 Some(Self::EKF_STATUS_REPORT(EKF_STATUS_REPORT_DATA::random(rng)))
45160 }
45161 ENCAPSULATED_DATA_DATA::ID => {
45162 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
45163 }
45164 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
45165 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
45166 ESC_TELEMETRY_13_TO_16_DATA::ID => Some(Self::ESC_TELEMETRY_13_TO_16(
45167 ESC_TELEMETRY_13_TO_16_DATA::random(rng),
45168 )),
45169 ESC_TELEMETRY_17_TO_20_DATA::ID => Some(Self::ESC_TELEMETRY_17_TO_20(
45170 ESC_TELEMETRY_17_TO_20_DATA::random(rng),
45171 )),
45172 ESC_TELEMETRY_1_TO_4_DATA::ID => Some(Self::ESC_TELEMETRY_1_TO_4(
45173 ESC_TELEMETRY_1_TO_4_DATA::random(rng),
45174 )),
45175 ESC_TELEMETRY_21_TO_24_DATA::ID => Some(Self::ESC_TELEMETRY_21_TO_24(
45176 ESC_TELEMETRY_21_TO_24_DATA::random(rng),
45177 )),
45178 ESC_TELEMETRY_25_TO_28_DATA::ID => Some(Self::ESC_TELEMETRY_25_TO_28(
45179 ESC_TELEMETRY_25_TO_28_DATA::random(rng),
45180 )),
45181 ESC_TELEMETRY_29_TO_32_DATA::ID => Some(Self::ESC_TELEMETRY_29_TO_32(
45182 ESC_TELEMETRY_29_TO_32_DATA::random(rng),
45183 )),
45184 ESC_TELEMETRY_5_TO_8_DATA::ID => Some(Self::ESC_TELEMETRY_5_TO_8(
45185 ESC_TELEMETRY_5_TO_8_DATA::random(rng),
45186 )),
45187 ESC_TELEMETRY_9_TO_12_DATA::ID => Some(Self::ESC_TELEMETRY_9_TO_12(
45188 ESC_TELEMETRY_9_TO_12_DATA::random(rng),
45189 )),
45190 ESTIMATOR_STATUS_DATA::ID => {
45191 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
45192 }
45193 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
45194 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
45195 EXTENDED_SYS_STATE_DATA::random(rng),
45196 )),
45197 FENCE_FETCH_POINT_DATA::ID => {
45198 Some(Self::FENCE_FETCH_POINT(FENCE_FETCH_POINT_DATA::random(rng)))
45199 }
45200 FENCE_POINT_DATA::ID => Some(Self::FENCE_POINT(FENCE_POINT_DATA::random(rng))),
45201 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
45202 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
45203 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
45204 )),
45205 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
45206 FLIGHT_INFORMATION_DATA::random(rng),
45207 )),
45208 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
45209 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
45210 GENERATOR_STATUS_DATA::ID => {
45211 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
45212 }
45213 GIMBAL_CONTROL_DATA::ID => Some(Self::GIMBAL_CONTROL(GIMBAL_CONTROL_DATA::random(rng))),
45214 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
45215 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
45216 )),
45217 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
45218 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
45219 )),
45220 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
45221 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
45222 )),
45223 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
45224 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
45225 )),
45226 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
45227 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
45228 )),
45229 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
45230 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
45231 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
45232 ))
45233 }
45234 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
45235 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
45236 )),
45237 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
45238 GIMBAL_MANAGER_STATUS_DATA::random(rng),
45239 )),
45240 GIMBAL_REPORT_DATA::ID => Some(Self::GIMBAL_REPORT(GIMBAL_REPORT_DATA::random(rng))),
45241 GIMBAL_TORQUE_CMD_REPORT_DATA::ID => Some(Self::GIMBAL_TORQUE_CMD_REPORT(
45242 GIMBAL_TORQUE_CMD_REPORT_DATA::random(rng),
45243 )),
45244 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
45245 GLOBAL_POSITION_INT_DATA::random(rng),
45246 )),
45247 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
45248 GLOBAL_POSITION_INT_COV_DATA::random(rng),
45249 )),
45250 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
45251 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
45252 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
45253 ))
45254 }
45255 GOPRO_GET_REQUEST_DATA::ID => {
45256 Some(Self::GOPRO_GET_REQUEST(GOPRO_GET_REQUEST_DATA::random(rng)))
45257 }
45258 GOPRO_GET_RESPONSE_DATA::ID => Some(Self::GOPRO_GET_RESPONSE(
45259 GOPRO_GET_RESPONSE_DATA::random(rng),
45260 )),
45261 GOPRO_HEARTBEAT_DATA::ID => {
45262 Some(Self::GOPRO_HEARTBEAT(GOPRO_HEARTBEAT_DATA::random(rng)))
45263 }
45264 GOPRO_SET_REQUEST_DATA::ID => {
45265 Some(Self::GOPRO_SET_REQUEST(GOPRO_SET_REQUEST_DATA::random(rng)))
45266 }
45267 GOPRO_SET_RESPONSE_DATA::ID => Some(Self::GOPRO_SET_RESPONSE(
45268 GOPRO_SET_RESPONSE_DATA::random(rng),
45269 )),
45270 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
45271 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
45272 GPS_GLOBAL_ORIGIN_DATA::ID => {
45273 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
45274 }
45275 GPS_INJECT_DATA_DATA::ID => {
45276 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
45277 }
45278 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
45279 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
45280 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
45281 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
45282 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
45283 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
45284 HERELINK_TELEM_DATA::ID => Some(Self::HERELINK_TELEM(HERELINK_TELEM_DATA::random(rng))),
45285 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
45286 Some(Self::HERELINK_VIDEO_STREAM_INFORMATION(
45287 HERELINK_VIDEO_STREAM_INFORMATION_DATA::random(rng),
45288 ))
45289 }
45290 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
45291 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
45292 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
45293 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
45294 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
45295 )),
45296 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
45297 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
45298 HIL_OPTICAL_FLOW_DATA::ID => {
45299 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
45300 }
45301 HIL_RC_INPUTS_RAW_DATA::ID => {
45302 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
45303 }
45304 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
45305 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
45306 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
45307 HIL_STATE_QUATERNION_DATA::random(rng),
45308 )),
45309 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
45310 HWSTATUS_DATA::ID => Some(Self::HWSTATUS(HWSTATUS_DATA::random(rng))),
45311 HYGROMETER_SENSOR_DATA::ID => {
45312 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
45313 }
45314 ICAROUS_HEARTBEAT_DATA::ID => {
45315 Some(Self::ICAROUS_HEARTBEAT(ICAROUS_HEARTBEAT_DATA::random(rng)))
45316 }
45317 ICAROUS_KINEMATIC_BANDS_DATA::ID => Some(Self::ICAROUS_KINEMATIC_BANDS(
45318 ICAROUS_KINEMATIC_BANDS_DATA::random(rng),
45319 )),
45320 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
45321 ILLUMINATOR_STATUS_DATA::random(rng),
45322 )),
45323 ISBD_LINK_STATUS_DATA::ID => {
45324 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
45325 }
45326 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
45327 LED_CONTROL_DATA::ID => Some(Self::LED_CONTROL(LED_CONTROL_DATA::random(rng))),
45328 LIMITS_STATUS_DATA::ID => Some(Self::LIMITS_STATUS(LIMITS_STATUS_DATA::random(rng))),
45329 LINK_NODE_STATUS_DATA::ID => {
45330 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
45331 }
45332 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
45333 LOCAL_POSITION_NED_DATA::random(rng),
45334 )),
45335 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
45336 LOCAL_POSITION_NED_COV_DATA::random(rng),
45337 )),
45338 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
45339 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
45340 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
45341 ))
45342 }
45343 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
45344 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
45345 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
45346 LOGGING_DATA_ACKED_DATA::random(rng),
45347 )),
45348 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
45349 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
45350 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
45351 LOG_REQUEST_DATA_DATA::ID => {
45352 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
45353 }
45354 LOG_REQUEST_END_DATA::ID => {
45355 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
45356 }
45357 LOG_REQUEST_LIST_DATA::ID => {
45358 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
45359 }
45360 LOWEHEISER_GOV_EFI_DATA::ID => Some(Self::LOWEHEISER_GOV_EFI(
45361 LOWEHEISER_GOV_EFI_DATA::random(rng),
45362 )),
45363 MAG_CAL_PROGRESS_DATA::ID => {
45364 Some(Self::MAG_CAL_PROGRESS(MAG_CAL_PROGRESS_DATA::random(rng)))
45365 }
45366 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
45367 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
45368 MANUAL_SETPOINT_DATA::ID => {
45369 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
45370 }
45371 MCU_STATUS_DATA::ID => Some(Self::MCU_STATUS(MCU_STATUS_DATA::random(rng))),
45372 MEMINFO_DATA::ID => Some(Self::MEMINFO(MEMINFO_DATA::random(rng))),
45373 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
45374 MESSAGE_INTERVAL_DATA::ID => {
45375 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
45376 }
45377 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
45378 MISSION_CLEAR_ALL_DATA::ID => {
45379 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
45380 }
45381 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
45382 MISSION_CURRENT_DATA::ID => {
45383 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
45384 }
45385 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
45386 MISSION_ITEM_INT_DATA::ID => {
45387 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
45388 }
45389 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
45390 MISSION_ITEM_REACHED_DATA::random(rng),
45391 )),
45392 MISSION_REQUEST_DATA::ID => {
45393 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
45394 }
45395 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
45396 MISSION_REQUEST_INT_DATA::random(rng),
45397 )),
45398 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
45399 MISSION_REQUEST_LIST_DATA::random(rng),
45400 )),
45401 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
45402 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
45403 )),
45404 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
45405 MISSION_SET_CURRENT_DATA::random(rng),
45406 )),
45407 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
45408 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
45409 )),
45410 MOUNT_CONFIGURE_DATA::ID => {
45411 Some(Self::MOUNT_CONFIGURE(MOUNT_CONFIGURE_DATA::random(rng)))
45412 }
45413 MOUNT_CONTROL_DATA::ID => Some(Self::MOUNT_CONTROL(MOUNT_CONTROL_DATA::random(rng))),
45414 MOUNT_ORIENTATION_DATA::ID => {
45415 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
45416 }
45417 MOUNT_STATUS_DATA::ID => Some(Self::MOUNT_STATUS(MOUNT_STATUS_DATA::random(rng))),
45418 NAMED_VALUE_FLOAT_DATA::ID => {
45419 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
45420 }
45421 NAMED_VALUE_INT_DATA::ID => {
45422 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
45423 }
45424 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
45425 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
45426 )),
45427 OBSTACLE_DISTANCE_DATA::ID => {
45428 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
45429 }
45430 OBSTACLE_DISTANCE_3D_DATA::ID => Some(Self::OBSTACLE_DISTANCE_3D(
45431 OBSTACLE_DISTANCE_3D_DATA::random(rng),
45432 )),
45433 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
45434 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
45435 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
45436 )),
45437 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
45438 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
45439 )),
45440 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
45441 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
45442 )),
45443 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
45444 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
45445 )),
45446 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
45447 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
45448 )),
45449 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
45450 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
45451 )),
45452 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
45453 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
45454 )),
45455 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
45456 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
45457 )),
45458 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
45459 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
45460 )),
45461 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
45462 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
45463 )),
45464 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
45465 OPTICAL_FLOW_RAD_DATA::ID => {
45466 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
45467 }
45468 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
45469 ORBIT_EXECUTION_STATUS_DATA::random(rng),
45470 )),
45471 OSD_PARAM_CONFIG_DATA::ID => {
45472 Some(Self::OSD_PARAM_CONFIG(OSD_PARAM_CONFIG_DATA::random(rng)))
45473 }
45474 OSD_PARAM_CONFIG_REPLY_DATA::ID => Some(Self::OSD_PARAM_CONFIG_REPLY(
45475 OSD_PARAM_CONFIG_REPLY_DATA::random(rng),
45476 )),
45477 OSD_PARAM_SHOW_CONFIG_DATA::ID => Some(Self::OSD_PARAM_SHOW_CONFIG(
45478 OSD_PARAM_SHOW_CONFIG_DATA::random(rng),
45479 )),
45480 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID => Some(Self::OSD_PARAM_SHOW_CONFIG_REPLY(
45481 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::random(rng),
45482 )),
45483 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
45484 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
45485 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
45486 )),
45487 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
45488 PARAM_EXT_REQUEST_READ_DATA::random(rng),
45489 )),
45490 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
45491 PARAM_EXT_VALUE_DATA::ID => {
45492 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
45493 }
45494 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
45495 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
45496 PARAM_REQUEST_LIST_DATA::random(rng),
45497 )),
45498 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
45499 PARAM_REQUEST_READ_DATA::random(rng),
45500 )),
45501 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
45502 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
45503 PID_TUNING_DATA::ID => Some(Self::PID_TUNING(PID_TUNING_DATA::random(rng))),
45504 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
45505 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
45506 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
45507 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
45508 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
45509 )),
45510 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
45511 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
45512 )),
45513 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
45514 PROTOCOL_VERSION_DATA::ID => {
45515 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
45516 }
45517 RADIO_DATA::ID => Some(Self::RADIO(RADIO_DATA::random(rng))),
45518 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
45519 RALLY_FETCH_POINT_DATA::ID => {
45520 Some(Self::RALLY_FETCH_POINT(RALLY_FETCH_POINT_DATA::random(rng)))
45521 }
45522 RALLY_POINT_DATA::ID => Some(Self::RALLY_POINT(RALLY_POINT_DATA::random(rng))),
45523 RANGEFINDER_DATA::ID => Some(Self::RANGEFINDER(RANGEFINDER_DATA::random(rng))),
45524 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
45525 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
45526 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
45527 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
45528 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
45529 RC_CHANNELS_OVERRIDE_DATA::random(rng),
45530 )),
45531 RC_CHANNELS_RAW_DATA::ID => {
45532 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
45533 }
45534 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
45535 RC_CHANNELS_SCALED_DATA::random(rng),
45536 )),
45537 REMOTE_LOG_BLOCK_STATUS_DATA::ID => Some(Self::REMOTE_LOG_BLOCK_STATUS(
45538 REMOTE_LOG_BLOCK_STATUS_DATA::random(rng),
45539 )),
45540 REMOTE_LOG_DATA_BLOCK_DATA::ID => Some(Self::REMOTE_LOG_DATA_BLOCK(
45541 REMOTE_LOG_DATA_BLOCK_DATA::random(rng),
45542 )),
45543 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
45544 REQUEST_DATA_STREAM_DATA::random(rng),
45545 )),
45546 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
45547 RESOURCE_REQUEST_DATA::ID => {
45548 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
45549 }
45550 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
45551 RESPONSE_EVENT_ERROR_DATA::random(rng),
45552 )),
45553 RPM_DATA::ID => Some(Self::RPM(RPM_DATA::random(rng))),
45554 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
45555 SAFETY_ALLOWED_AREA_DATA::random(rng),
45556 )),
45557 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
45558 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
45559 )),
45560 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
45561 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
45562 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
45563 SCALED_PRESSURE_DATA::ID => {
45564 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
45565 }
45566 SCALED_PRESSURE2_DATA::ID => {
45567 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
45568 }
45569 SCALED_PRESSURE3_DATA::ID => {
45570 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
45571 }
45572 SECURE_COMMAND_DATA::ID => Some(Self::SECURE_COMMAND(SECURE_COMMAND_DATA::random(rng))),
45573 SECURE_COMMAND_REPLY_DATA::ID => Some(Self::SECURE_COMMAND_REPLY(
45574 SECURE_COMMAND_REPLY_DATA::random(rng),
45575 )),
45576 SENSOR_OFFSETS_DATA::ID => Some(Self::SENSOR_OFFSETS(SENSOR_OFFSETS_DATA::random(rng))),
45577 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
45578 SERVO_OUTPUT_RAW_DATA::ID => {
45579 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
45580 }
45581 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
45582 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
45583 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
45584 )),
45585 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
45586 SET_ATTITUDE_TARGET_DATA::random(rng),
45587 )),
45588 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
45589 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
45590 )),
45591 SET_HOME_POSITION_DATA::ID => {
45592 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
45593 }
45594 SET_MAG_OFFSETS_DATA::ID => {
45595 Some(Self::SET_MAG_OFFSETS(SET_MAG_OFFSETS_DATA::random(rng)))
45596 }
45597 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
45598 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
45599 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
45600 )),
45601 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
45602 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
45603 )),
45604 SIMSTATE_DATA::ID => Some(Self::SIMSTATE(SIMSTATE_DATA::random(rng))),
45605 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
45606 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
45607 SMART_BATTERY_INFO_DATA::random(rng),
45608 )),
45609 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
45610 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
45611 STORAGE_INFORMATION_DATA::random(rng),
45612 )),
45613 SUPPORTED_TUNES_DATA::ID => {
45614 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
45615 }
45616 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
45617 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
45618 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
45619 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
45620 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
45621 TERRAIN_REQUEST_DATA::ID => {
45622 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
45623 }
45624 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
45625 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
45626 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
45627 )),
45628 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
45629 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
45630 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
45631 ))
45632 }
45633 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
45634 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
45635 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
45636 ))
45637 }
45638 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
45639 UAVCAN_NODE_INFO_DATA::ID => {
45640 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
45641 }
45642 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
45643 UAVCAN_NODE_STATUS_DATA::random(rng),
45644 )),
45645 UAVIONIX_ADSB_GET_DATA::ID => {
45646 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::random(rng)))
45647 }
45648 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
45649 UAVIONIX_ADSB_OUT_CFG_DATA::random(rng),
45650 )),
45651 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
45652 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::random(rng),
45653 )),
45654 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
45655 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
45656 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::random(rng),
45657 ))
45658 }
45659 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
45660 UAVIONIX_ADSB_OUT_CONTROL_DATA::random(rng),
45661 )),
45662 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
45663 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::random(rng),
45664 )),
45665 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
45666 UAVIONIX_ADSB_OUT_STATUS_DATA::random(rng),
45667 )),
45668 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
45669 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
45670 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::random(rng),
45671 ))
45672 }
45673 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
45674 UTM_GLOBAL_POSITION_DATA::random(rng),
45675 )),
45676 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
45677 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
45678 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
45679 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
45680 VICON_POSITION_ESTIMATE_DATA::random(rng),
45681 )),
45682 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
45683 VIDEO_STREAM_INFORMATION_DATA::random(rng),
45684 )),
45685 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
45686 VIDEO_STREAM_STATUS_DATA::random(rng),
45687 )),
45688 VISION_POSITION_DELTA_DATA::ID => Some(Self::VISION_POSITION_DELTA(
45689 VISION_POSITION_DELTA_DATA::random(rng),
45690 )),
45691 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
45692 VISION_POSITION_ESTIMATE_DATA::random(rng),
45693 )),
45694 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
45695 VISION_SPEED_ESTIMATE_DATA::random(rng),
45696 )),
45697 WATER_DEPTH_DATA::ID => Some(Self::WATER_DEPTH(WATER_DEPTH_DATA::random(rng))),
45698 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
45699 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
45700 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
45701 WIND_DATA::ID => Some(Self::WIND(WIND_DATA::random(rng))),
45702 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
45703 _ => None,
45704 }
45705 }
45706 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
45707 match self {
45708 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
45709 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
45710 Self::ADAP_TUNING(body) => body.ser(version, bytes),
45711 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
45712 Self::AHRS(body) => body.ser(version, bytes),
45713 Self::AHRS2(body) => body.ser(version, bytes),
45714 Self::AHRS3(body) => body.ser(version, bytes),
45715 Self::AIRLINK_AUTH(body) => body.ser(version, bytes),
45716 Self::AIRLINK_AUTH_RESPONSE(body) => body.ser(version, bytes),
45717 Self::AIRSPEED_AUTOCAL(body) => body.ser(version, bytes),
45718 Self::AIS_VESSEL(body) => body.ser(version, bytes),
45719 Self::ALTITUDE(body) => body.ser(version, bytes),
45720 Self::AOA_SSA(body) => body.ser(version, bytes),
45721 Self::AP_ADC(body) => body.ser(version, bytes),
45722 Self::ATTITUDE(body) => body.ser(version, bytes),
45723 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
45724 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
45725 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
45726 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
45727 Self::AUTH_KEY(body) => body.ser(version, bytes),
45728 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
45729 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
45730 Self::AUTOPILOT_VERSION_REQUEST(body) => body.ser(version, bytes),
45731 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
45732 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
45733 Self::BATTERY2(body) => body.ser(version, bytes),
45734 Self::BATTERY_INFO(body) => body.ser(version, bytes),
45735 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
45736 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
45737 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
45738 Self::CAMERA_FEEDBACK(body) => body.ser(version, bytes),
45739 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
45740 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
45741 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
45742 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
45743 Self::CAMERA_STATUS(body) => body.ser(version, bytes),
45744 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
45745 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
45746 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
45747 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
45748 Self::CANFD_FRAME(body) => body.ser(version, bytes),
45749 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
45750 Self::CAN_FRAME(body) => body.ser(version, bytes),
45751 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
45752 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
45753 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
45754 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
45755 Self::COLLISION(body) => body.ser(version, bytes),
45756 Self::COMMAND_ACK(body) => body.ser(version, bytes),
45757 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
45758 Self::COMMAND_INT(body) => body.ser(version, bytes),
45759 Self::COMMAND_LONG(body) => body.ser(version, bytes),
45760 Self::COMPASSMOT_STATUS(body) => body.ser(version, bytes),
45761 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
45762 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
45763 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
45764 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
45765 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(body) => body.ser(version, bytes),
45766 Self::CUBEPILOT_FIRMWARE_UPDATE_START(body) => body.ser(version, bytes),
45767 Self::CUBEPILOT_RAW_RC(body) => body.ser(version, bytes),
45768 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
45769 Self::CURRENT_MODE(body) => body.ser(version, bytes),
45770 Self::DATA16(body) => body.ser(version, bytes),
45771 Self::DATA32(body) => body.ser(version, bytes),
45772 Self::DATA64(body) => body.ser(version, bytes),
45773 Self::DATA96(body) => body.ser(version, bytes),
45774 Self::DATA_STREAM(body) => body.ser(version, bytes),
45775 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
45776 Self::DEBUG(body) => body.ser(version, bytes),
45777 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
45778 Self::DEBUG_VECT(body) => body.ser(version, bytes),
45779 Self::DEEPSTALL(body) => body.ser(version, bytes),
45780 Self::DEVICE_OP_READ(body) => body.ser(version, bytes),
45781 Self::DEVICE_OP_READ_REPLY(body) => body.ser(version, bytes),
45782 Self::DEVICE_OP_WRITE(body) => body.ser(version, bytes),
45783 Self::DEVICE_OP_WRITE_REPLY(body) => body.ser(version, bytes),
45784 Self::DIGICAM_CONFIGURE(body) => body.ser(version, bytes),
45785 Self::DIGICAM_CONTROL(body) => body.ser(version, bytes),
45786 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
45787 Self::EFI_STATUS(body) => body.ser(version, bytes),
45788 Self::EKF_STATUS_REPORT(body) => body.ser(version, bytes),
45789 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
45790 Self::ESC_INFO(body) => body.ser(version, bytes),
45791 Self::ESC_STATUS(body) => body.ser(version, bytes),
45792 Self::ESC_TELEMETRY_13_TO_16(body) => body.ser(version, bytes),
45793 Self::ESC_TELEMETRY_17_TO_20(body) => body.ser(version, bytes),
45794 Self::ESC_TELEMETRY_1_TO_4(body) => body.ser(version, bytes),
45795 Self::ESC_TELEMETRY_21_TO_24(body) => body.ser(version, bytes),
45796 Self::ESC_TELEMETRY_25_TO_28(body) => body.ser(version, bytes),
45797 Self::ESC_TELEMETRY_29_TO_32(body) => body.ser(version, bytes),
45798 Self::ESC_TELEMETRY_5_TO_8(body) => body.ser(version, bytes),
45799 Self::ESC_TELEMETRY_9_TO_12(body) => body.ser(version, bytes),
45800 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
45801 Self::EVENT(body) => body.ser(version, bytes),
45802 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
45803 Self::FENCE_FETCH_POINT(body) => body.ser(version, bytes),
45804 Self::FENCE_POINT(body) => body.ser(version, bytes),
45805 Self::FENCE_STATUS(body) => body.ser(version, bytes),
45806 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
45807 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
45808 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
45809 Self::FUEL_STATUS(body) => body.ser(version, bytes),
45810 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
45811 Self::GIMBAL_CONTROL(body) => body.ser(version, bytes),
45812 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
45813 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
45814 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
45815 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
45816 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
45817 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
45818 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
45819 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
45820 Self::GIMBAL_REPORT(body) => body.ser(version, bytes),
45821 Self::GIMBAL_TORQUE_CMD_REPORT(body) => body.ser(version, bytes),
45822 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
45823 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
45824 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
45825 Self::GOPRO_GET_REQUEST(body) => body.ser(version, bytes),
45826 Self::GOPRO_GET_RESPONSE(body) => body.ser(version, bytes),
45827 Self::GOPRO_HEARTBEAT(body) => body.ser(version, bytes),
45828 Self::GOPRO_SET_REQUEST(body) => body.ser(version, bytes),
45829 Self::GOPRO_SET_RESPONSE(body) => body.ser(version, bytes),
45830 Self::GPS2_RAW(body) => body.ser(version, bytes),
45831 Self::GPS2_RTK(body) => body.ser(version, bytes),
45832 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
45833 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
45834 Self::GPS_INPUT(body) => body.ser(version, bytes),
45835 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
45836 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
45837 Self::GPS_RTK(body) => body.ser(version, bytes),
45838 Self::GPS_STATUS(body) => body.ser(version, bytes),
45839 Self::HEARTBEAT(body) => body.ser(version, bytes),
45840 Self::HERELINK_TELEM(body) => body.ser(version, bytes),
45841 Self::HERELINK_VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
45842 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
45843 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
45844 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
45845 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
45846 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
45847 Self::HIL_GPS(body) => body.ser(version, bytes),
45848 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
45849 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
45850 Self::HIL_SENSOR(body) => body.ser(version, bytes),
45851 Self::HIL_STATE(body) => body.ser(version, bytes),
45852 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
45853 Self::HOME_POSITION(body) => body.ser(version, bytes),
45854 Self::HWSTATUS(body) => body.ser(version, bytes),
45855 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
45856 Self::ICAROUS_HEARTBEAT(body) => body.ser(version, bytes),
45857 Self::ICAROUS_KINEMATIC_BANDS(body) => body.ser(version, bytes),
45858 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
45859 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
45860 Self::LANDING_TARGET(body) => body.ser(version, bytes),
45861 Self::LED_CONTROL(body) => body.ser(version, bytes),
45862 Self::LIMITS_STATUS(body) => body.ser(version, bytes),
45863 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
45864 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
45865 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
45866 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
45867 Self::LOGGING_ACK(body) => body.ser(version, bytes),
45868 Self::LOGGING_DATA(body) => body.ser(version, bytes),
45869 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
45870 Self::LOG_DATA(body) => body.ser(version, bytes),
45871 Self::LOG_ENTRY(body) => body.ser(version, bytes),
45872 Self::LOG_ERASE(body) => body.ser(version, bytes),
45873 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
45874 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
45875 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
45876 Self::LOWEHEISER_GOV_EFI(body) => body.ser(version, bytes),
45877 Self::MAG_CAL_PROGRESS(body) => body.ser(version, bytes),
45878 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
45879 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
45880 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
45881 Self::MCU_STATUS(body) => body.ser(version, bytes),
45882 Self::MEMINFO(body) => body.ser(version, bytes),
45883 Self::MEMORY_VECT(body) => body.ser(version, bytes),
45884 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
45885 Self::MISSION_ACK(body) => body.ser(version, bytes),
45886 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
45887 Self::MISSION_COUNT(body) => body.ser(version, bytes),
45888 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
45889 Self::MISSION_ITEM(body) => body.ser(version, bytes),
45890 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
45891 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
45892 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
45893 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
45894 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
45895 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
45896 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
45897 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
45898 Self::MOUNT_CONFIGURE(body) => body.ser(version, bytes),
45899 Self::MOUNT_CONTROL(body) => body.ser(version, bytes),
45900 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
45901 Self::MOUNT_STATUS(body) => body.ser(version, bytes),
45902 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
45903 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
45904 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
45905 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
45906 Self::OBSTACLE_DISTANCE_3D(body) => body.ser(version, bytes),
45907 Self::ODOMETRY(body) => body.ser(version, bytes),
45908 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
45909 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
45910 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
45911 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
45912 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
45913 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
45914 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
45915 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
45916 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
45917 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
45918 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
45919 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
45920 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
45921 Self::OSD_PARAM_CONFIG(body) => body.ser(version, bytes),
45922 Self::OSD_PARAM_CONFIG_REPLY(body) => body.ser(version, bytes),
45923 Self::OSD_PARAM_SHOW_CONFIG(body) => body.ser(version, bytes),
45924 Self::OSD_PARAM_SHOW_CONFIG_REPLY(body) => body.ser(version, bytes),
45925 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
45926 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
45927 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
45928 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
45929 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
45930 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
45931 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
45932 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
45933 Self::PARAM_SET(body) => body.ser(version, bytes),
45934 Self::PARAM_VALUE(body) => body.ser(version, bytes),
45935 Self::PID_TUNING(body) => body.ser(version, bytes),
45936 Self::PING(body) => body.ser(version, bytes),
45937 Self::PLAY_TUNE(body) => body.ser(version, bytes),
45938 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
45939 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
45940 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
45941 Self::POWER_STATUS(body) => body.ser(version, bytes),
45942 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
45943 Self::RADIO(body) => body.ser(version, bytes),
45944 Self::RADIO_STATUS(body) => body.ser(version, bytes),
45945 Self::RALLY_FETCH_POINT(body) => body.ser(version, bytes),
45946 Self::RALLY_POINT(body) => body.ser(version, bytes),
45947 Self::RANGEFINDER(body) => body.ser(version, bytes),
45948 Self::RAW_IMU(body) => body.ser(version, bytes),
45949 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
45950 Self::RAW_RPM(body) => body.ser(version, bytes),
45951 Self::RC_CHANNELS(body) => body.ser(version, bytes),
45952 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
45953 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
45954 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
45955 Self::REMOTE_LOG_BLOCK_STATUS(body) => body.ser(version, bytes),
45956 Self::REMOTE_LOG_DATA_BLOCK(body) => body.ser(version, bytes),
45957 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
45958 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
45959 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
45960 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
45961 Self::RPM(body) => body.ser(version, bytes),
45962 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
45963 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
45964 Self::SCALED_IMU(body) => body.ser(version, bytes),
45965 Self::SCALED_IMU2(body) => body.ser(version, bytes),
45966 Self::SCALED_IMU3(body) => body.ser(version, bytes),
45967 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
45968 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
45969 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
45970 Self::SECURE_COMMAND(body) => body.ser(version, bytes),
45971 Self::SECURE_COMMAND_REPLY(body) => body.ser(version, bytes),
45972 Self::SENSOR_OFFSETS(body) => body.ser(version, bytes),
45973 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
45974 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
45975 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
45976 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
45977 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
45978 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
45979 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
45980 Self::SET_MAG_OFFSETS(body) => body.ser(version, bytes),
45981 Self::SET_MODE(body) => body.ser(version, bytes),
45982 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
45983 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
45984 Self::SIMSTATE(body) => body.ser(version, bytes),
45985 Self::SIM_STATE(body) => body.ser(version, bytes),
45986 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
45987 Self::STATUSTEXT(body) => body.ser(version, bytes),
45988 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
45989 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
45990 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
45991 Self::SYS_STATUS(body) => body.ser(version, bytes),
45992 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
45993 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
45994 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
45995 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
45996 Self::TIMESYNC(body) => body.ser(version, bytes),
45997 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
45998 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
45999 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
46000 Self::TUNNEL(body) => body.ser(version, bytes),
46001 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
46002 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
46003 Self::UAVIONIX_ADSB_GET(body) => body.ser(version, bytes),
46004 Self::UAVIONIX_ADSB_OUT_CFG(body) => body.ser(version, bytes),
46005 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(body) => body.ser(version, bytes),
46006 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(body) => body.ser(version, bytes),
46007 Self::UAVIONIX_ADSB_OUT_CONTROL(body) => body.ser(version, bytes),
46008 Self::UAVIONIX_ADSB_OUT_DYNAMIC(body) => body.ser(version, bytes),
46009 Self::UAVIONIX_ADSB_OUT_STATUS(body) => body.ser(version, bytes),
46010 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(body) => body.ser(version, bytes),
46011 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
46012 Self::V2_EXTENSION(body) => body.ser(version, bytes),
46013 Self::VFR_HUD(body) => body.ser(version, bytes),
46014 Self::VIBRATION(body) => body.ser(version, bytes),
46015 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
46016 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
46017 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
46018 Self::VISION_POSITION_DELTA(body) => body.ser(version, bytes),
46019 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
46020 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
46021 Self::WATER_DEPTH(body) => body.ser(version, bytes),
46022 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
46023 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
46024 Self::WINCH_STATUS(body) => body.ser(version, bytes),
46025 Self::WIND(body) => body.ser(version, bytes),
46026 Self::WIND_COV(body) => body.ser(version, bytes),
46027 }
46028 }
46029 fn extra_crc(id: u32) -> u8 {
46030 match id {
46031 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
46032 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
46033 ADAP_TUNING_DATA::ID => ADAP_TUNING_DATA::EXTRA_CRC,
46034 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
46035 AHRS_DATA::ID => AHRS_DATA::EXTRA_CRC,
46036 AHRS2_DATA::ID => AHRS2_DATA::EXTRA_CRC,
46037 AHRS3_DATA::ID => AHRS3_DATA::EXTRA_CRC,
46038 AIRLINK_AUTH_DATA::ID => AIRLINK_AUTH_DATA::EXTRA_CRC,
46039 AIRLINK_AUTH_RESPONSE_DATA::ID => AIRLINK_AUTH_RESPONSE_DATA::EXTRA_CRC,
46040 AIRSPEED_AUTOCAL_DATA::ID => AIRSPEED_AUTOCAL_DATA::EXTRA_CRC,
46041 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
46042 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
46043 AOA_SSA_DATA::ID => AOA_SSA_DATA::EXTRA_CRC,
46044 AP_ADC_DATA::ID => AP_ADC_DATA::EXTRA_CRC,
46045 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
46046 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
46047 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
46048 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
46049 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
46050 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
46051 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
46052 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
46053 }
46054 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
46055 AUTOPILOT_VERSION_REQUEST_DATA::ID => AUTOPILOT_VERSION_REQUEST_DATA::EXTRA_CRC,
46056 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
46057 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
46058 BATTERY2_DATA::ID => BATTERY2_DATA::EXTRA_CRC,
46059 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
46060 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
46061 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
46062 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
46063 CAMERA_FEEDBACK_DATA::ID => CAMERA_FEEDBACK_DATA::EXTRA_CRC,
46064 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
46065 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
46066 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
46067 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
46068 CAMERA_STATUS_DATA::ID => CAMERA_STATUS_DATA::EXTRA_CRC,
46069 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
46070 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
46071 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
46072 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
46073 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
46074 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
46075 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
46076 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
46077 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
46078 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
46079 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
46080 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
46081 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
46082 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
46083 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
46084 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
46085 COMPASSMOT_STATUS_DATA::ID => COMPASSMOT_STATUS_DATA::EXTRA_CRC,
46086 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
46087 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
46088 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
46089 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
46090 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::ID => {
46091 CUBEPILOT_FIRMWARE_UPDATE_RESP_DATA::EXTRA_CRC
46092 }
46093 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::ID => {
46094 CUBEPILOT_FIRMWARE_UPDATE_START_DATA::EXTRA_CRC
46095 }
46096 CUBEPILOT_RAW_RC_DATA::ID => CUBEPILOT_RAW_RC_DATA::EXTRA_CRC,
46097 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
46098 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
46099 DATA16_DATA::ID => DATA16_DATA::EXTRA_CRC,
46100 DATA32_DATA::ID => DATA32_DATA::EXTRA_CRC,
46101 DATA64_DATA::ID => DATA64_DATA::EXTRA_CRC,
46102 DATA96_DATA::ID => DATA96_DATA::EXTRA_CRC,
46103 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
46104 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
46105 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
46106 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
46107 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
46108 DEEPSTALL_DATA::ID => DEEPSTALL_DATA::EXTRA_CRC,
46109 DEVICE_OP_READ_DATA::ID => DEVICE_OP_READ_DATA::EXTRA_CRC,
46110 DEVICE_OP_READ_REPLY_DATA::ID => DEVICE_OP_READ_REPLY_DATA::EXTRA_CRC,
46111 DEVICE_OP_WRITE_DATA::ID => DEVICE_OP_WRITE_DATA::EXTRA_CRC,
46112 DEVICE_OP_WRITE_REPLY_DATA::ID => DEVICE_OP_WRITE_REPLY_DATA::EXTRA_CRC,
46113 DIGICAM_CONFIGURE_DATA::ID => DIGICAM_CONFIGURE_DATA::EXTRA_CRC,
46114 DIGICAM_CONTROL_DATA::ID => DIGICAM_CONTROL_DATA::EXTRA_CRC,
46115 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
46116 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
46117 EKF_STATUS_REPORT_DATA::ID => EKF_STATUS_REPORT_DATA::EXTRA_CRC,
46118 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
46119 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
46120 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
46121 ESC_TELEMETRY_13_TO_16_DATA::ID => ESC_TELEMETRY_13_TO_16_DATA::EXTRA_CRC,
46122 ESC_TELEMETRY_17_TO_20_DATA::ID => ESC_TELEMETRY_17_TO_20_DATA::EXTRA_CRC,
46123 ESC_TELEMETRY_1_TO_4_DATA::ID => ESC_TELEMETRY_1_TO_4_DATA::EXTRA_CRC,
46124 ESC_TELEMETRY_21_TO_24_DATA::ID => ESC_TELEMETRY_21_TO_24_DATA::EXTRA_CRC,
46125 ESC_TELEMETRY_25_TO_28_DATA::ID => ESC_TELEMETRY_25_TO_28_DATA::EXTRA_CRC,
46126 ESC_TELEMETRY_29_TO_32_DATA::ID => ESC_TELEMETRY_29_TO_32_DATA::EXTRA_CRC,
46127 ESC_TELEMETRY_5_TO_8_DATA::ID => ESC_TELEMETRY_5_TO_8_DATA::EXTRA_CRC,
46128 ESC_TELEMETRY_9_TO_12_DATA::ID => ESC_TELEMETRY_9_TO_12_DATA::EXTRA_CRC,
46129 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
46130 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
46131 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
46132 FENCE_FETCH_POINT_DATA::ID => FENCE_FETCH_POINT_DATA::EXTRA_CRC,
46133 FENCE_POINT_DATA::ID => FENCE_POINT_DATA::EXTRA_CRC,
46134 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
46135 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
46136 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
46137 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
46138 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
46139 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
46140 GIMBAL_CONTROL_DATA::ID => GIMBAL_CONTROL_DATA::EXTRA_CRC,
46141 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
46142 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
46143 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
46144 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
46145 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
46146 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
46147 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
46148 }
46149 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
46150 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
46151 GIMBAL_REPORT_DATA::ID => GIMBAL_REPORT_DATA::EXTRA_CRC,
46152 GIMBAL_TORQUE_CMD_REPORT_DATA::ID => GIMBAL_TORQUE_CMD_REPORT_DATA::EXTRA_CRC,
46153 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
46154 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
46155 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
46156 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
46157 }
46158 GOPRO_GET_REQUEST_DATA::ID => GOPRO_GET_REQUEST_DATA::EXTRA_CRC,
46159 GOPRO_GET_RESPONSE_DATA::ID => GOPRO_GET_RESPONSE_DATA::EXTRA_CRC,
46160 GOPRO_HEARTBEAT_DATA::ID => GOPRO_HEARTBEAT_DATA::EXTRA_CRC,
46161 GOPRO_SET_REQUEST_DATA::ID => GOPRO_SET_REQUEST_DATA::EXTRA_CRC,
46162 GOPRO_SET_RESPONSE_DATA::ID => GOPRO_SET_RESPONSE_DATA::EXTRA_CRC,
46163 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
46164 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
46165 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
46166 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
46167 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
46168 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
46169 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
46170 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
46171 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
46172 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
46173 HERELINK_TELEM_DATA::ID => HERELINK_TELEM_DATA::EXTRA_CRC,
46174 HERELINK_VIDEO_STREAM_INFORMATION_DATA::ID => {
46175 HERELINK_VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC
46176 }
46177 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
46178 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
46179 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
46180 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
46181 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
46182 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
46183 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
46184 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
46185 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
46186 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
46187 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
46188 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
46189 HWSTATUS_DATA::ID => HWSTATUS_DATA::EXTRA_CRC,
46190 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
46191 ICAROUS_HEARTBEAT_DATA::ID => ICAROUS_HEARTBEAT_DATA::EXTRA_CRC,
46192 ICAROUS_KINEMATIC_BANDS_DATA::ID => ICAROUS_KINEMATIC_BANDS_DATA::EXTRA_CRC,
46193 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
46194 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
46195 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
46196 LED_CONTROL_DATA::ID => LED_CONTROL_DATA::EXTRA_CRC,
46197 LIMITS_STATUS_DATA::ID => LIMITS_STATUS_DATA::EXTRA_CRC,
46198 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
46199 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
46200 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
46201 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
46202 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
46203 }
46204 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
46205 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
46206 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
46207 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
46208 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
46209 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
46210 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
46211 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
46212 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
46213 LOWEHEISER_GOV_EFI_DATA::ID => LOWEHEISER_GOV_EFI_DATA::EXTRA_CRC,
46214 MAG_CAL_PROGRESS_DATA::ID => MAG_CAL_PROGRESS_DATA::EXTRA_CRC,
46215 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
46216 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
46217 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
46218 MCU_STATUS_DATA::ID => MCU_STATUS_DATA::EXTRA_CRC,
46219 MEMINFO_DATA::ID => MEMINFO_DATA::EXTRA_CRC,
46220 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
46221 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
46222 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
46223 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
46224 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
46225 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
46226 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
46227 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
46228 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
46229 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
46230 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
46231 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
46232 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
46233 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
46234 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
46235 MOUNT_CONFIGURE_DATA::ID => MOUNT_CONFIGURE_DATA::EXTRA_CRC,
46236 MOUNT_CONTROL_DATA::ID => MOUNT_CONTROL_DATA::EXTRA_CRC,
46237 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
46238 MOUNT_STATUS_DATA::ID => MOUNT_STATUS_DATA::EXTRA_CRC,
46239 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
46240 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
46241 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
46242 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
46243 OBSTACLE_DISTANCE_3D_DATA::ID => OBSTACLE_DISTANCE_3D_DATA::EXTRA_CRC,
46244 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
46245 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
46246 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
46247 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
46248 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
46249 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
46250 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
46251 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
46252 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
46253 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
46254 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
46255 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
46256 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
46257 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
46258 OSD_PARAM_CONFIG_DATA::ID => OSD_PARAM_CONFIG_DATA::EXTRA_CRC,
46259 OSD_PARAM_CONFIG_REPLY_DATA::ID => OSD_PARAM_CONFIG_REPLY_DATA::EXTRA_CRC,
46260 OSD_PARAM_SHOW_CONFIG_DATA::ID => OSD_PARAM_SHOW_CONFIG_DATA::EXTRA_CRC,
46261 OSD_PARAM_SHOW_CONFIG_REPLY_DATA::ID => OSD_PARAM_SHOW_CONFIG_REPLY_DATA::EXTRA_CRC,
46262 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
46263 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
46264 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
46265 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
46266 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
46267 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
46268 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
46269 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
46270 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
46271 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
46272 PID_TUNING_DATA::ID => PID_TUNING_DATA::EXTRA_CRC,
46273 PING_DATA::ID => PING_DATA::EXTRA_CRC,
46274 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
46275 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
46276 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
46277 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
46278 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
46279 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
46280 RADIO_DATA::ID => RADIO_DATA::EXTRA_CRC,
46281 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
46282 RALLY_FETCH_POINT_DATA::ID => RALLY_FETCH_POINT_DATA::EXTRA_CRC,
46283 RALLY_POINT_DATA::ID => RALLY_POINT_DATA::EXTRA_CRC,
46284 RANGEFINDER_DATA::ID => RANGEFINDER_DATA::EXTRA_CRC,
46285 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
46286 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
46287 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
46288 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
46289 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
46290 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
46291 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
46292 REMOTE_LOG_BLOCK_STATUS_DATA::ID => REMOTE_LOG_BLOCK_STATUS_DATA::EXTRA_CRC,
46293 REMOTE_LOG_DATA_BLOCK_DATA::ID => REMOTE_LOG_DATA_BLOCK_DATA::EXTRA_CRC,
46294 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
46295 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
46296 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
46297 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
46298 RPM_DATA::ID => RPM_DATA::EXTRA_CRC,
46299 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
46300 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
46301 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
46302 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
46303 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
46304 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
46305 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
46306 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
46307 SECURE_COMMAND_DATA::ID => SECURE_COMMAND_DATA::EXTRA_CRC,
46308 SECURE_COMMAND_REPLY_DATA::ID => SECURE_COMMAND_REPLY_DATA::EXTRA_CRC,
46309 SENSOR_OFFSETS_DATA::ID => SENSOR_OFFSETS_DATA::EXTRA_CRC,
46310 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
46311 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
46312 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
46313 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
46314 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
46315 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
46316 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
46317 SET_MAG_OFFSETS_DATA::ID => SET_MAG_OFFSETS_DATA::EXTRA_CRC,
46318 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
46319 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
46320 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
46321 }
46322 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
46323 SIMSTATE_DATA::ID => SIMSTATE_DATA::EXTRA_CRC,
46324 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
46325 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
46326 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
46327 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
46328 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
46329 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
46330 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
46331 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
46332 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
46333 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
46334 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
46335 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
46336 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
46337 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
46338 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
46339 }
46340 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
46341 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
46342 }
46343 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
46344 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
46345 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
46346 UAVIONIX_ADSB_GET_DATA::ID => UAVIONIX_ADSB_GET_DATA::EXTRA_CRC,
46347 UAVIONIX_ADSB_OUT_CFG_DATA::ID => UAVIONIX_ADSB_OUT_CFG_DATA::EXTRA_CRC,
46348 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
46349 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::EXTRA_CRC
46350 }
46351 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
46352 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::EXTRA_CRC
46353 }
46354 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => UAVIONIX_ADSB_OUT_CONTROL_DATA::EXTRA_CRC,
46355 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::EXTRA_CRC,
46356 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => UAVIONIX_ADSB_OUT_STATUS_DATA::EXTRA_CRC,
46357 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
46358 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::EXTRA_CRC
46359 }
46360 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
46361 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
46362 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
46363 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
46364 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
46365 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
46366 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
46367 VISION_POSITION_DELTA_DATA::ID => VISION_POSITION_DELTA_DATA::EXTRA_CRC,
46368 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
46369 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
46370 WATER_DEPTH_DATA::ID => WATER_DEPTH_DATA::EXTRA_CRC,
46371 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
46372 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
46373 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
46374 WIND_DATA::ID => WIND_DATA::EXTRA_CRC,
46375 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
46376 _ => 0,
46377 }
46378 }
46379 fn target_system_id(&self) -> Option<u8> {
46380 match self {
46381 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
46382 Self::AUTOPILOT_VERSION_REQUEST(inner) => Some(inner.target_system),
46383 Self::CAMERA_FEEDBACK(inner) => Some(inner.target_system),
46384 Self::CAMERA_STATUS(inner) => Some(inner.target_system),
46385 Self::CANFD_FRAME(inner) => Some(inner.target_system),
46386 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
46387 Self::CAN_FRAME(inner) => Some(inner.target_system),
46388 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
46389 Self::COMMAND_ACK(inner) => Some(inner.target_system),
46390 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
46391 Self::COMMAND_INT(inner) => Some(inner.target_system),
46392 Self::COMMAND_LONG(inner) => Some(inner.target_system),
46393 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_system),
46394 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_system),
46395 Self::DEVICE_OP_READ(inner) => Some(inner.target_system),
46396 Self::DEVICE_OP_WRITE(inner) => Some(inner.target_system),
46397 Self::DIGICAM_CONFIGURE(inner) => Some(inner.target_system),
46398 Self::DIGICAM_CONTROL(inner) => Some(inner.target_system),
46399 Self::FENCE_FETCH_POINT(inner) => Some(inner.target_system),
46400 Self::FENCE_POINT(inner) => Some(inner.target_system),
46401 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
46402 Self::GIMBAL_CONTROL(inner) => Some(inner.target_system),
46403 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
46404 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
46405 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
46406 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
46407 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
46408 Self::GIMBAL_REPORT(inner) => Some(inner.target_system),
46409 Self::GIMBAL_TORQUE_CMD_REPORT(inner) => Some(inner.target_system),
46410 Self::GOPRO_GET_REQUEST(inner) => Some(inner.target_system),
46411 Self::GOPRO_SET_REQUEST(inner) => Some(inner.target_system),
46412 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
46413 Self::LED_CONTROL(inner) => Some(inner.target_system),
46414 Self::LOGGING_ACK(inner) => Some(inner.target_system),
46415 Self::LOGGING_DATA(inner) => Some(inner.target_system),
46416 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
46417 Self::LOG_ERASE(inner) => Some(inner.target_system),
46418 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
46419 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
46420 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
46421 Self::MISSION_ACK(inner) => Some(inner.target_system),
46422 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
46423 Self::MISSION_COUNT(inner) => Some(inner.target_system),
46424 Self::MISSION_ITEM(inner) => Some(inner.target_system),
46425 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
46426 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
46427 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
46428 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
46429 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
46430 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
46431 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
46432 Self::MOUNT_CONFIGURE(inner) => Some(inner.target_system),
46433 Self::MOUNT_CONTROL(inner) => Some(inner.target_system),
46434 Self::MOUNT_STATUS(inner) => Some(inner.target_system),
46435 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
46436 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
46437 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
46438 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
46439 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
46440 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
46441 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
46442 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
46443 Self::OSD_PARAM_CONFIG(inner) => Some(inner.target_system),
46444 Self::OSD_PARAM_SHOW_CONFIG(inner) => Some(inner.target_system),
46445 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
46446 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
46447 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
46448 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
46449 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
46450 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
46451 Self::PARAM_SET(inner) => Some(inner.target_system),
46452 Self::PING(inner) => Some(inner.target_system),
46453 Self::PLAY_TUNE(inner) => Some(inner.target_system),
46454 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
46455 Self::RALLY_FETCH_POINT(inner) => Some(inner.target_system),
46456 Self::RALLY_POINT(inner) => Some(inner.target_system),
46457 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
46458 Self::REMOTE_LOG_BLOCK_STATUS(inner) => Some(inner.target_system),
46459 Self::REMOTE_LOG_DATA_BLOCK(inner) => Some(inner.target_system),
46460 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
46461 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
46462 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
46463 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
46464 Self::SECURE_COMMAND(inner) => Some(inner.target_system),
46465 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
46466 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
46467 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
46468 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
46469 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
46470 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
46471 Self::SET_MAG_OFFSETS(inner) => Some(inner.target_system),
46472 Self::SET_MODE(inner) => Some(inner.target_system),
46473 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
46474 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
46475 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
46476 Self::TIMESYNC(inner) => Some(inner.target_system),
46477 Self::TUNNEL(inner) => Some(inner.target_system),
46478 Self::V2_EXTENSION(inner) => Some(inner.target_system),
46479 _ => None,
46480 }
46481 }
46482 fn target_component_id(&self) -> Option<u8> {
46483 match self {
46484 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
46485 Self::AUTOPILOT_VERSION_REQUEST(inner) => Some(inner.target_component),
46486 Self::CANFD_FRAME(inner) => Some(inner.target_component),
46487 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
46488 Self::CAN_FRAME(inner) => Some(inner.target_component),
46489 Self::COMMAND_ACK(inner) => Some(inner.target_component),
46490 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
46491 Self::COMMAND_INT(inner) => Some(inner.target_component),
46492 Self::COMMAND_LONG(inner) => Some(inner.target_component),
46493 Self::CUBEPILOT_FIRMWARE_UPDATE_RESP(inner) => Some(inner.target_component),
46494 Self::CUBEPILOT_FIRMWARE_UPDATE_START(inner) => Some(inner.target_component),
46495 Self::DEVICE_OP_READ(inner) => Some(inner.target_component),
46496 Self::DEVICE_OP_WRITE(inner) => Some(inner.target_component),
46497 Self::DIGICAM_CONFIGURE(inner) => Some(inner.target_component),
46498 Self::DIGICAM_CONTROL(inner) => Some(inner.target_component),
46499 Self::FENCE_FETCH_POINT(inner) => Some(inner.target_component),
46500 Self::FENCE_POINT(inner) => Some(inner.target_component),
46501 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
46502 Self::GIMBAL_CONTROL(inner) => Some(inner.target_component),
46503 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
46504 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
46505 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
46506 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
46507 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
46508 Self::GIMBAL_REPORT(inner) => Some(inner.target_component),
46509 Self::GIMBAL_TORQUE_CMD_REPORT(inner) => Some(inner.target_component),
46510 Self::GOPRO_GET_REQUEST(inner) => Some(inner.target_component),
46511 Self::GOPRO_SET_REQUEST(inner) => Some(inner.target_component),
46512 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
46513 Self::LED_CONTROL(inner) => Some(inner.target_component),
46514 Self::LOGGING_ACK(inner) => Some(inner.target_component),
46515 Self::LOGGING_DATA(inner) => Some(inner.target_component),
46516 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
46517 Self::LOG_ERASE(inner) => Some(inner.target_component),
46518 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
46519 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
46520 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
46521 Self::MISSION_ACK(inner) => Some(inner.target_component),
46522 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
46523 Self::MISSION_COUNT(inner) => Some(inner.target_component),
46524 Self::MISSION_ITEM(inner) => Some(inner.target_component),
46525 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
46526 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
46527 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
46528 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
46529 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
46530 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
46531 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
46532 Self::MOUNT_CONFIGURE(inner) => Some(inner.target_component),
46533 Self::MOUNT_CONTROL(inner) => Some(inner.target_component),
46534 Self::MOUNT_STATUS(inner) => Some(inner.target_component),
46535 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
46536 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
46537 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
46538 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
46539 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
46540 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
46541 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
46542 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
46543 Self::OSD_PARAM_CONFIG(inner) => Some(inner.target_component),
46544 Self::OSD_PARAM_SHOW_CONFIG(inner) => Some(inner.target_component),
46545 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
46546 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
46547 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
46548 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
46549 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
46550 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
46551 Self::PARAM_SET(inner) => Some(inner.target_component),
46552 Self::PING(inner) => Some(inner.target_component),
46553 Self::PLAY_TUNE(inner) => Some(inner.target_component),
46554 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
46555 Self::RALLY_FETCH_POINT(inner) => Some(inner.target_component),
46556 Self::RALLY_POINT(inner) => Some(inner.target_component),
46557 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
46558 Self::REMOTE_LOG_BLOCK_STATUS(inner) => Some(inner.target_component),
46559 Self::REMOTE_LOG_DATA_BLOCK(inner) => Some(inner.target_component),
46560 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
46561 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
46562 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
46563 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
46564 Self::SECURE_COMMAND(inner) => Some(inner.target_component),
46565 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
46566 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
46567 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
46568 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
46569 Self::SET_MAG_OFFSETS(inner) => Some(inner.target_component),
46570 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
46571 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
46572 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
46573 Self::TIMESYNC(inner) => Some(inner.target_component),
46574 Self::TUNNEL(inner) => Some(inner.target_component),
46575 Self::V2_EXTENSION(inner) => Some(inner.target_component),
46576 _ => None,
46577 }
46578 }
46579}